claude-mpm 5.4.65__py3-none-any.whl → 5.6.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of claude-mpm might be problematic. Click here for more details.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/CLAUDE_MPM_OUTPUT_STYLE.md +66 -241
- claude_mpm/agents/CLAUDE_MPM_RESEARCH_OUTPUT_STYLE.md +413 -0
- claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +107 -1928
- claude_mpm/agents/PM_INSTRUCTIONS.md +119 -689
- claude_mpm/agents/WORKFLOW.md +2 -0
- claude_mpm/agents/templates/circuit-breakers.md +26 -17
- claude_mpm/cli/__init__.py +5 -1
- claude_mpm/cli/commands/agents.py +2 -4
- claude_mpm/cli/commands/agents_reconcile.py +197 -0
- claude_mpm/cli/commands/autotodos.py +566 -0
- claude_mpm/cli/commands/commander.py +46 -0
- claude_mpm/cli/commands/configure.py +620 -21
- claude_mpm/cli/commands/hook_errors.py +60 -60
- claude_mpm/cli/commands/monitor.py +2 -2
- claude_mpm/cli/commands/mpm_init/core.py +2 -2
- claude_mpm/cli/commands/run.py +35 -3
- claude_mpm/cli/commands/skill_source.py +51 -2
- claude_mpm/cli/commands/skills.py +171 -17
- claude_mpm/cli/executor.py +120 -16
- claude_mpm/cli/interactive/__init__.py +10 -0
- claude_mpm/cli/interactive/agent_wizard.py +30 -50
- claude_mpm/cli/interactive/questionary_styles.py +65 -0
- claude_mpm/cli/interactive/skill_selector.py +481 -0
- claude_mpm/cli/parsers/base_parser.py +76 -1
- claude_mpm/cli/parsers/commander_parser.py +83 -0
- claude_mpm/cli/parsers/run_parser.py +10 -0
- claude_mpm/cli/parsers/skill_source_parser.py +4 -0
- claude_mpm/cli/parsers/skills_parser.py +5 -0
- claude_mpm/cli/startup.py +203 -359
- claude_mpm/cli/startup_display.py +72 -5
- claude_mpm/cli/startup_logging.py +2 -2
- claude_mpm/cli/utils.py +7 -3
- claude_mpm/commander/__init__.py +72 -0
- claude_mpm/commander/adapters/__init__.py +31 -0
- claude_mpm/commander/adapters/base.py +191 -0
- claude_mpm/commander/adapters/claude_code.py +361 -0
- claude_mpm/commander/adapters/communication.py +366 -0
- claude_mpm/commander/api/__init__.py +16 -0
- claude_mpm/commander/api/app.py +105 -0
- claude_mpm/commander/api/errors.py +133 -0
- claude_mpm/commander/api/routes/__init__.py +8 -0
- claude_mpm/commander/api/routes/events.py +184 -0
- claude_mpm/commander/api/routes/inbox.py +171 -0
- claude_mpm/commander/api/routes/messages.py +148 -0
- claude_mpm/commander/api/routes/projects.py +271 -0
- claude_mpm/commander/api/routes/sessions.py +228 -0
- claude_mpm/commander/api/routes/work.py +260 -0
- claude_mpm/commander/api/schemas.py +182 -0
- claude_mpm/commander/chat/__init__.py +7 -0
- claude_mpm/commander/chat/cli.py +107 -0
- claude_mpm/commander/chat/commands.py +96 -0
- claude_mpm/commander/chat/repl.py +310 -0
- claude_mpm/commander/config.py +49 -0
- claude_mpm/commander/config_loader.py +115 -0
- claude_mpm/commander/daemon.py +398 -0
- claude_mpm/commander/events/__init__.py +26 -0
- claude_mpm/commander/events/manager.py +332 -0
- claude_mpm/commander/frameworks/__init__.py +12 -0
- claude_mpm/commander/frameworks/base.py +143 -0
- claude_mpm/commander/frameworks/claude_code.py +58 -0
- claude_mpm/commander/frameworks/mpm.py +62 -0
- claude_mpm/commander/inbox/__init__.py +16 -0
- claude_mpm/commander/inbox/dedup.py +128 -0
- claude_mpm/commander/inbox/inbox.py +224 -0
- claude_mpm/commander/inbox/models.py +70 -0
- claude_mpm/commander/instance_manager.py +337 -0
- claude_mpm/commander/llm/__init__.py +6 -0
- claude_mpm/commander/llm/openrouter_client.py +167 -0
- claude_mpm/commander/llm/summarizer.py +70 -0
- claude_mpm/commander/models/__init__.py +18 -0
- claude_mpm/commander/models/events.py +121 -0
- claude_mpm/commander/models/project.py +162 -0
- claude_mpm/commander/models/work.py +214 -0
- claude_mpm/commander/parsing/__init__.py +20 -0
- claude_mpm/commander/parsing/extractor.py +132 -0
- claude_mpm/commander/parsing/output_parser.py +270 -0
- claude_mpm/commander/parsing/patterns.py +100 -0
- claude_mpm/commander/persistence/__init__.py +11 -0
- claude_mpm/commander/persistence/event_store.py +274 -0
- claude_mpm/commander/persistence/state_store.py +309 -0
- claude_mpm/commander/persistence/work_store.py +164 -0
- claude_mpm/commander/polling/__init__.py +13 -0
- claude_mpm/commander/polling/event_detector.py +104 -0
- claude_mpm/commander/polling/output_buffer.py +49 -0
- claude_mpm/commander/polling/output_poller.py +153 -0
- claude_mpm/commander/project_session.py +268 -0
- claude_mpm/commander/proxy/__init__.py +12 -0
- claude_mpm/commander/proxy/formatter.py +89 -0
- claude_mpm/commander/proxy/output_handler.py +191 -0
- claude_mpm/commander/proxy/relay.py +155 -0
- claude_mpm/commander/registry.py +404 -0
- claude_mpm/commander/runtime/__init__.py +10 -0
- claude_mpm/commander/runtime/executor.py +191 -0
- claude_mpm/commander/runtime/monitor.py +316 -0
- claude_mpm/commander/session/__init__.py +6 -0
- claude_mpm/commander/session/context.py +81 -0
- claude_mpm/commander/session/manager.py +59 -0
- claude_mpm/commander/tmux_orchestrator.py +361 -0
- claude_mpm/commander/web/__init__.py +1 -0
- claude_mpm/commander/work/__init__.py +30 -0
- claude_mpm/commander/work/executor.py +189 -0
- claude_mpm/commander/work/queue.py +405 -0
- claude_mpm/commander/workflow/__init__.py +27 -0
- claude_mpm/commander/workflow/event_handler.py +219 -0
- claude_mpm/commander/workflow/notifier.py +146 -0
- claude_mpm/commands/mpm-config.md +8 -0
- claude_mpm/commands/mpm-doctor.md +8 -0
- claude_mpm/commands/mpm-help.md +8 -0
- claude_mpm/commands/mpm-init.md +8 -0
- claude_mpm/commands/mpm-monitor.md +8 -0
- claude_mpm/commands/mpm-organize.md +8 -0
- claude_mpm/commands/mpm-postmortem.md +8 -0
- claude_mpm/commands/mpm-session-resume.md +9 -1
- claude_mpm/commands/mpm-status.md +8 -0
- claude_mpm/commands/mpm-ticket-view.md +8 -0
- claude_mpm/commands/mpm-version.md +8 -0
- claude_mpm/commands/mpm.md +8 -0
- claude_mpm/config/agent_presets.py +8 -7
- claude_mpm/config/skill_sources.py +16 -0
- claude_mpm/constants.py +1 -0
- claude_mpm/core/claude_runner.py +2 -2
- claude_mpm/core/config.py +32 -19
- claude_mpm/core/hook_manager.py +51 -3
- claude_mpm/core/interactive_session.py +7 -7
- claude_mpm/core/logger.py +26 -9
- claude_mpm/core/logging_utils.py +35 -11
- claude_mpm/core/output_style_manager.py +31 -13
- claude_mpm/core/unified_config.py +54 -8
- claude_mpm/core/unified_paths.py +95 -90
- claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/0.C33zOoyM.css +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/2.CW1J-YuA.css +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Cs_tUR18.js → 1WZnGYqX.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CDuw-vjf.js → 67pF3qNn.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{bTOqqlTd.js → 6RxdMKe4.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DwBR2MJi.js → 8cZrfX0h.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{ZGh7QtNv.js → 9a6T2nm-.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{D9lljYKQ.js → B443AUzu.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{RJiighC3.js → B8AwtY2H.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{uuIeMWc-.js → BF15LAsF.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{D3k0OPJN.js → BRcwIQNr.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CyWMqx4W.js → BV6nKitt.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CiIAseT4.js → BViJ8lZt.js} +5 -5
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CBBdVcY8.js → BcQ-Q0FE.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{BovzEFCE.js → Bpyvgze_.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/BzTRqg-z.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/C0Fr8dve.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{eNVUfhuA.js → C3rbW_a-.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{GYwsonyD.js → C8WYN38h.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{BIF9m_hv.js → C9I8FlXH.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{B0uc0UOD.js → CIQcWgO2.js} +3 -3
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Be7GpZd6.js → CIctN7YN.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Bh0LDWpI.js → CKrS_JZW.js} +2 -2
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DUrLdbGD.js → CR6P9C4A.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{B7xVLGWV.js → CRRR9MD_.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CRcR2DqT.js +334 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Dhb8PKl3.js → CSXtMOf0.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{BPYeabCQ.js → CT-sbxSk.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{sQeU3Y1z.js → CWm6DJsp.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CnA0NrzZ.js → CpqQ1Kzn.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{C4B-KCzX.js → D2nGpDRe.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DGkLK5U1.js → D9iCMida.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{BofRWZRR.js → D9ykgMoY.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DmxopI1J.js → DL2Ldur1.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{C30mlcqg.js → DPfltzjH.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Vzk33B_K.js → DR8nis88.js} +2 -2
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DI7hHRFL.js → DUliQN2b.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{C4JcI4KD.js → DXlhR01x.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{bT1r9zLR.js → D_lyTybS.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DZX00Y4g.js → DngoTTgh.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CzZX-COe.js → DqkmHtDC.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{B7RN905-.js → DsDh8EYs.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DLVjFsZ3.js → DypDmXgd.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{iEWssX7S.js → IPYC-LnN.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/JTLiF7dt.js +24 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DaimHw_p.js → JpevfAFt.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{DY1XQ8fi.js → R8CEIRAd.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Dle-35c7.js → Zxy7qc-l.js} +2 -2
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/q9Hm6zAU.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{C_Usid8X.js → qtd3IeO4.js} +2 -2
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{CzeYkLYB.js → ulBFON_C.js} +2 -2
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/{Cfqx1Qun.js → wQVh1CoA.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/{app.D6-I5TpK.js → app.Dr7t0z2J.js} +2 -2
- claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/start.BGhZHUS3.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/{0.m1gL8KXf.js → 0.RgBboRvH.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/{1.CgNOuw-d.js → 1.DG-KkbDf.js} +1 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/2.D_jnf-x6.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/version.json +1 -1
- claude_mpm/dashboard/static/svelte-build/index.html +9 -9
- claude_mpm/experimental/cli_enhancements.py +2 -1
- claude_mpm/hooks/claude_hooks/INTEGRATION_EXAMPLE.md +243 -0
- claude_mpm/hooks/claude_hooks/README_AUTO_PAUSE.md +403 -0
- claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/auto_pause_handler.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/auto_pause_handler.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/auto_pause_handler.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/auto_pause_handler.py +485 -0
- claude_mpm/hooks/claude_hooks/event_handlers.py +283 -87
- claude_mpm/hooks/claude_hooks/hook_handler.py +106 -89
- claude_mpm/hooks/claude_hooks/hook_wrapper.sh +6 -11
- claude_mpm/hooks/claude_hooks/installer.py +116 -8
- claude_mpm/hooks/claude_hooks/memory_integration.py +51 -31
- claude_mpm/hooks/claude_hooks/response_tracking.py +42 -59
- claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-312.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-314.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/connection_manager.py +39 -24
- claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +36 -103
- claude_mpm/hooks/claude_hooks/services/state_manager.py +23 -36
- claude_mpm/hooks/claude_hooks/services/subagent_processor.py +73 -75
- claude_mpm/hooks/session_resume_hook.py +89 -1
- claude_mpm/hooks/templates/pre_tool_use_template.py +10 -2
- claude_mpm/init.py +1 -1
- claude_mpm/scripts/claude-hook-handler.sh +43 -16
- claude_mpm/services/agents/agent_recommendation_service.py +8 -8
- claude_mpm/services/agents/agent_selection_service.py +2 -2
- claude_mpm/services/agents/cache_git_manager.py +1 -1
- claude_mpm/services/agents/deployment/deployment_reconciler.py +577 -0
- claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +3 -0
- claude_mpm/services/agents/deployment/startup_reconciliation.py +138 -0
- claude_mpm/services/agents/loading/framework_agent_loader.py +75 -2
- claude_mpm/services/agents/single_tier_deployment_service.py +4 -4
- claude_mpm/services/agents/startup_sync.py +5 -2
- claude_mpm/services/cli/__init__.py +3 -0
- claude_mpm/services/cli/incremental_pause_manager.py +561 -0
- claude_mpm/services/cli/session_resume_helper.py +10 -2
- claude_mpm/services/delegation_detector.py +175 -0
- claude_mpm/services/diagnostics/checks/agent_sources_check.py +30 -0
- claude_mpm/services/diagnostics/checks/configuration_check.py +24 -0
- claude_mpm/services/diagnostics/checks/installation_check.py +22 -0
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +23 -0
- claude_mpm/services/diagnostics/doctor_reporter.py +31 -1
- claude_mpm/services/diagnostics/models.py +14 -1
- claude_mpm/services/event_log.py +325 -0
- claude_mpm/services/infrastructure/__init__.py +4 -0
- claude_mpm/services/infrastructure/context_usage_tracker.py +291 -0
- claude_mpm/services/infrastructure/resume_log_generator.py +24 -5
- claude_mpm/services/monitor/daemon_manager.py +15 -4
- claude_mpm/services/monitor/management/lifecycle.py +8 -2
- claude_mpm/services/monitor/server.py +106 -16
- claude_mpm/services/pm_skills_deployer.py +259 -87
- claude_mpm/services/skills/git_skill_source_manager.py +135 -11
- claude_mpm/services/skills/selective_skill_deployer.py +142 -26
- claude_mpm/services/skills/skill_discovery_service.py +74 -4
- claude_mpm/services/skills_deployer.py +31 -5
- claude_mpm/services/socketio/handlers/hook.py +14 -7
- claude_mpm/services/socketio/server/main.py +12 -4
- claude_mpm/skills/bundled/pm/mpm/SKILL.md +38 -0
- claude_mpm/skills/bundled/pm/mpm-agent-update-workflow/SKILL.md +75 -0
- claude_mpm/skills/bundled/pm/mpm-bug-reporting/SKILL.md +248 -0
- claude_mpm/skills/bundled/pm/mpm-circuit-breaker-enforcement/SKILL.md +476 -0
- claude_mpm/skills/bundled/pm/mpm-config/SKILL.md +29 -0
- claude_mpm/skills/bundled/pm/mpm-doctor/SKILL.md +53 -0
- claude_mpm/skills/bundled/pm/mpm-help/SKILL.md +35 -0
- claude_mpm/skills/bundled/pm/mpm-init/SKILL.md +125 -0
- claude_mpm/skills/bundled/pm/mpm-monitor/SKILL.md +32 -0
- claude_mpm/skills/bundled/pm/mpm-organize/SKILL.md +121 -0
- claude_mpm/skills/bundled/pm/mpm-postmortem/SKILL.md +22 -0
- claude_mpm/skills/bundled/pm/mpm-session-management/SKILL.md +312 -0
- claude_mpm/skills/bundled/pm/mpm-session-resume/SKILL.md +31 -0
- claude_mpm/skills/bundled/pm/mpm-status/SKILL.md +37 -0
- claude_mpm/skills/bundled/pm/mpm-teaching-mode/SKILL.md +657 -0
- claude_mpm/skills/bundled/pm/mpm-ticket-view/SKILL.md +110 -0
- claude_mpm/skills/bundled/pm/mpm-tool-usage-guide/SKILL.md +386 -0
- claude_mpm/skills/bundled/pm/mpm-version/SKILL.md +21 -0
- claude_mpm/skills/skill_manager.py +4 -4
- claude_mpm/utils/agent_dependency_loader.py +4 -2
- claude_mpm/utils/robust_installer.py +10 -6
- claude_mpm-5.6.10.dist-info/METADATA +391 -0
- {claude_mpm-5.4.65.dist-info → claude_mpm-5.6.10.dist-info}/RECORD +303 -181
- claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/0.DWzvg0-y.css +0 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/2.ThTw9_ym.css +0 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/4TdZjIqw.js +0 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/5shd3_w0.js +0 -24
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/BKjSRqUr.js +0 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/Da0KfYnO.js +0 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/Dfy6j1xT.js +0 -323
- claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/start.NWzMBYRp.js +0 -1
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/2.C0GcWctS.js +0 -1
- claude_mpm-5.4.65.dist-info/METADATA +0 -999
- /claude_mpm/skills/bundled/pm/{pm-delegation-patterns → mpm-delegation-patterns}/SKILL.md +0 -0
- /claude_mpm/skills/bundled/pm/{pm-git-file-tracking → mpm-git-file-tracking}/SKILL.md +0 -0
- /claude_mpm/skills/bundled/pm/{pm-pr-workflow → mpm-pr-workflow}/SKILL.md +0 -0
- /claude_mpm/skills/bundled/pm/{pm-ticketing-integration → mpm-ticketing-integration}/SKILL.md +0 -0
- /claude_mpm/skills/bundled/pm/{pm-verification-protocols → mpm-verification-protocols}/SKILL.md +0 -0
- {claude_mpm-5.4.65.dist-info → claude_mpm-5.6.10.dist-info}/WHEEL +0 -0
- {claude_mpm-5.4.65.dist-info → claude_mpm-5.6.10.dist-info}/entry_points.txt +0 -0
- {claude_mpm-5.4.65.dist-info → claude_mpm-5.6.10.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-5.4.65.dist-info → claude_mpm-5.6.10.dist-info}/licenses/LICENSE-FAQ.md +0 -0
- {claude_mpm-5.4.65.dist-info → claude_mpm-5.6.10.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BRcwIQNr.js","./CWm6DJsp.js","./C8WYN38h.js","./B443AUzu.js","./BF15LAsF.js","./q9Hm6zAU.js","./6RxdMKe4.js","./BQaXIfA_.js","./wQVh1CoA.js","./D_lyTybS.js","./IPYC-LnN.js","./qtd3IeO4.js","./CpqQ1Kzn.js","./CT-sbxSk.js","./BzTRqg-z.js","./8cZrfX0h.js","./ulBFON_C.js","./DUliQN2b.js","./C3rbW_a-.js","./BViJ8lZt.js","./DVp1hx9R.js","./NqQ1dWOy.js","./D9iCMida.js","./DL2Ldur1.js","./Gi6I4Gst.js","./D2nGpDRe.js","./CRRR9MD_.js","./Bpyvgze_.js","./BcQ-Q0FE.js","./CmKTTxBW.js","./CIctN7YN.js","./9a6T2nm-.js","./Zxy7qc-l.js","./CKrS_JZW.js","./67pF3qNn.js","./DPfltzjH.js","./DngoTTgh.js","./DsDh8EYs.js","./DqkmHtDC.js","./CSXtMOf0.js","./DypDmXgd.js","./C9I8FlXH.js","./JpevfAFt.js","./CR6P9C4A.js","./D9ykgMoY.js","./1WZnGYqX.js","./BV6nKitt.js","./DXlhR01x.js","./CIQcWgO2.js","./JTLiF7dt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Mv=Object.defineProperty;var Lv=(e,t,r)=>t in e?Mv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var jt=(e,t,r)=>Lv(e,typeof t!="symbol"?t+"":t,r);import{b as qu,d as Bv,f as it,a as Z,e as aa,c as Ge,t as $v}from"./C0Fr8dve.js";import{x as ar,z as uc,J as sp,g as v,aA as Rv,ar as Ov,L as Nv,Z as Hu,C as Nn,ab as un,y as an,K as xh,ag as Iv,W as ju,ao as Ci,M as Va,aq as Dv,ae as vh,aM as op,F as Uu,al as _h,aN as Fv,aO as Pv,aP as zv,n as $n,A as Hs,aQ as Si,aR as lp,ap as cp,O as hp,aS as Rl,I as up,a9 as lo,aT as Wv,ad as qv,X as co,t as xt,w as Hv,aU as jv,ah as Uv,aa as Gv,aV as Yv,aW as dp,as as Qo,aX as fp,a4 as Vv,aY as Xv,aZ as Zv,a_ as pp,a$ as Kv,b0 as Qv,b1 as Jv,b2 as t_,b3 as e_,b4 as r_,b5 as i_,b6 as n_,b7 as a_,an as s_,b as gp,G as o_,p as Ir,am as ae,aB as Bi,a as ir,ai as et,b8 as Jo,s as H,j as $,i as Dr,l as we,k as L,m as Ee,o as tl,Y as Ji,b9 as l_,au as Ol,ba as Nl,bb as mp,bc as bp,bd as yp,e as js,be as xp,bf as c_,bg as Gu}from"./NqQ1dWOy.js";import{i as h_,c as u_,d as Ur,n as d_,a as f_,s as tt,e as Yu}from"./R8CEIRAd.js";import{s as tn,i as mt,a as vp,c as Vu,p as We,b as Xa,l as Vn,d as _p,_ as Ne}from"./DVp1hx9R.js";import{c as p_,d as g_,b as Ae,a as Xn,t as In,s as kp}from"./DR8nis88.js";import{i as wp}from"./BSNlmTZj.js";function di(e,t){return t}function m_(e,t,r){for(var i=[],n=t.length,a,o=t.length,s=0;s<n;s++){let u=t[s];hp(u,()=>{if(a){if(a.pending.delete(u),a.done.add(u),a.pending.size===0){var f=e.outrogroups;dc(vh(a.done)),f.delete(a),f.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var c=i.length===0&&r!==null;if(c){var l=r,h=l.parentNode;qv(h),h.append(l),e.items.clear()}dc(t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(a)}function dc(e,t=!0){for(var r=0;r<e.length;r++)co(e[r],t)}var Xu;function hr(e,t,r,i,n,a=null){var o=e,s=new Map,c=(t&lp)!==0;if(c){var l=e;o=ar?Nn($n(l)):l.appendChild(Hs())}ar&&uc();var h=null,u=Rv(()=>{var y=r();return op(y)?y:y==null?[]:vh(y)}),f,d=!0;function p(){b.fallback=h,b_(b,f,o,t,i),h!==null&&(f.length===0?(h.f&Si)===0?cp(h):(h.f^=Si,Ma(h,null,o)):hp(h,()=>{h=null}))}var g=sp(()=>{f=v(u);var y=f.length;let x=!1;if(ar){var C=Ov(o)===Nv;C!==(y===0)&&(o=Hu(),Nn(o),un(!1),x=!0)}for(var A=new Set,B=Ci,w=Dv(),E=0;E<y;E+=1){ar&&an.nodeType===xh&&an.data===Iv&&(o=an,x=!0,un(!1));var I=f[E],Y=i(I,E),q=d?null:s.get(Y);q?(q.v&&ju(q.v,I),q.i&&ju(q.i,E),w&&B.skipped_effects.delete(q.e)):(q=y_(s,d?o:Xu??(Xu=Hs()),I,Y,E,n,t,r),d||(q.e.f|=Si),s.set(Y,q)),A.add(Y)}if(y===0&&a&&!h&&(d?h=Va(()=>a(o)):(h=Va(()=>a(Xu??(Xu=Hs()))),h.f|=Si)),ar&&y>0&&Nn(Hu()),!d)if(w){for(const[F,z]of s)A.has(F)||B.skipped_effects.add(z.e);B.oncommit(p),B.ondiscard(()=>{})}else p();x&&un(!0),v(u)}),b={effect:g,items:s,outrogroups:null,fallback:h};d=!1,ar&&(o=an)}function b_(e,t,r,i,n){var q,F,z,D,_,T,k,S,M;var a=(i&Wv)!==0,o=t.length,s=e.items,c=e.effect.first,l,h=null,u,f=[],d=[],p,g,b,y;if(a)for(y=0;y<o;y+=1)p=t[y],g=n(p,y),b=s.get(g).e,(b.f&Si)===0&&((F=(q=b.nodes)==null?void 0:q.a)==null||F.measure(),(u??(u=new Set)).add(b));for(y=0;y<o;y+=1){if(p=t[y],g=n(p,y),b=s.get(g).e,e.outrogroups!==null)for(const W of e.outrogroups)W.pending.delete(b),W.done.delete(b);if((b.f&Si)!==0)if(b.f^=Si,b===c)Ma(b,null,r);else{var x=h?h.next:c;b===e.effect.last&&(e.effect.last=b.prev),b.prev&&(b.prev.next=b.next),b.next&&(b.next.prev=b.prev),Ri(e,h,b),Ri(e,b,x),Ma(b,x,r),h=b,f=[],d=[],c=h.next;continue}if((b.f&Rl)!==0&&(cp(b),a&&((D=(z=b.nodes)==null?void 0:z.a)==null||D.unfix(),(u??(u=new Set)).delete(b))),b!==c){if(l!==void 0&&l.has(b)){if(f.length<d.length){var C=d[0],A;h=C.prev;var B=f[0],w=f[f.length-1];for(A=0;A<f.length;A+=1)Ma(f[A],C,r);for(A=0;A<d.length;A+=1)l.delete(d[A]);Ri(e,B.prev,w.next),Ri(e,h,B),Ri(e,w,C),c=C,h=w,y-=1,f=[],d=[]}else l.delete(b),Ma(b,c,r),Ri(e,b.prev,b.next),Ri(e,b,h===null?e.effect.first:h.next),Ri(e,h,b),h=b;continue}for(f=[],d=[];c!==null&&c!==b;)(l??(l=new Set)).add(c),d.push(c),c=c.next;if(c===null)continue}(b.f&Si)===0&&f.push(b),h=b,c=b.next}if(e.outrogroups!==null){for(const W of e.outrogroups)W.pending.size===0&&(dc(vh(W.done)),(_=e.outrogroups)==null||_.delete(W));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var E=[];if(l!==void 0)for(b of l)(b.f&Rl)===0&&E.push(b);for(;c!==null;)(c.f&Rl)===0&&c!==e.fallback&&E.push(c),c=c.next;var I=E.length;if(I>0){var Y=(i&lp)!==0&&o===0?r:null;if(a){for(y=0;y<I;y+=1)(k=(T=E[y].nodes)==null?void 0:T.a)==null||k.measure();for(y=0;y<I;y+=1)(M=(S=E[y].nodes)==null?void 0:S.a)==null||M.fix()}m_(e,E,Y)}}a&&up(()=>{var W,N;if(u!==void 0)for(b of u)(N=(W=b.nodes)==null?void 0:W.a)==null||N.apply()})}function y_(e,t,r,i,n,a,o,s){var c=(o&Pv)!==0?(o&zv)===0?_h(r,!1,!1):Uu(r):null,l=(o&Fv)!==0?Uu(n):null;return{v:c,i:l,e:Va(()=>(a(t,c??r,l??n,s),()=>{e.delete(i)}))}}function Ma(e,t,r){if(e.nodes)for(var i=e.nodes.start,n=e.nodes.end,a=t&&(t.f&Si)===0?t.nodes.start:r;i!==null;){var o=lo(i);if(a.before(i),i===n)return;i=o}}function Ri(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function kh(e,t,r=!1,i=!1,n=!1){var a=e,o="";xt(()=>{var s=Hv;if(o===(o=t()??"")){ar&&uc();return}if(s.nodes!==null&&(jv(s.nodes.start,s.nodes.end),s.nodes=null),o!==""){if(ar){an.data;for(var c=uc(),l=c;c!==null&&(c.nodeType!==xh||c.data!=="");)l=c,c=lo(c);if(c===null)throw Uv(),Gv;qu(an,l),a=Nn(c);return}var h=o+"";r?h=`<svg>${h}</svg>`:i&&(h=`<math>${h}</math>`);var u=Bv(h);if((r||i)&&(u=$n(u)),qu($n(u),u.lastChild),r||i)for(;$n(u);)a.before($n(u));else a.before(u)}})}function x_(e,t){let r=null,i=ar;var n;if(ar){r=an;for(var a=$n(document.head);a!==null&&(a.nodeType!==xh||a.data!==e);)a=lo(a);if(a===null)un(!1);else{var o=lo(a);a.remove(),Nn(o)}}ar||(n=document.head.appendChild(Hs()));try{sp(()=>t(n),Yv)}finally{i&&(un(!0),Nn(r))}}function v_(e,t){var r=void 0,i;dp(()=>{r!==(r=t())&&(i&&(co(i),i=null),r&&(i=Va(()=>{Qo(()=>r(e))})))})}function Il(e,t={},r,i){for(var n in r){var a=r[n];t[n]!==a&&(r[n]==null?e.style.removeProperty(n):e.style.setProperty(n,a,i))}}function Di(e,t,r,i){var n=e.__style;if(ar||n!==t){var a=p_(t,i);(!ar||a!==e.getAttribute("style"))&&(a==null?e.removeAttribute("style"):e.style.cssText=a),e.__style=t}else i&&(Array.isArray(i)?(Il(e,r==null?void 0:r[0],i[0]),Il(e,r==null?void 0:r[1],i[1],"important")):Il(e,r,i));return i}function ho(e,t,r=!1){if(e.multiple){if(t==null)return;if(!op(t))return Xv();for(var i of e.options)i.selected=t.includes(za(i));return}for(i of e.options){var n=za(i);if(Zv(n,t)){i.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function Cp(e){var t=new MutationObserver(()=>{ho(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Vv(()=>{t.disconnect()})}function Za(e,t,r=t){var i=new WeakSet,n=!0;fp(e,"change",a=>{var o=a?"[selected]":":checked",s;if(e.multiple)s=[].map.call(e.querySelectorAll(o),za);else{var c=e.querySelector(o)??e.querySelector("option:not([disabled])");s=c&&za(c)}r(s),Ci!==null&&i.add(Ci)}),Qo(()=>{var a=t();if(e===document.activeElement){var o=pp??Ci;if(i.has(o))return}if(ho(e,a,n),n&&a===void 0){var s=e.querySelector(":checked");s!==null&&(a=za(s),r(a))}e.__value=a,n=!1}),Cp(e)}function za(e){return"__value"in e?e.__value:e.value}const La=Symbol("class"),da=Symbol("style"),Sp=Symbol("is custom element"),Tp=Symbol("is html");function Ep(e){if(ar){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;Ue(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var n=e.checked;Ue(e,"checked",null),e.checked=n}}};e.__on_r=r,up(r),e_()}}function __(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Ue(e,t,r,i){var n=Ap(e);ar&&(n[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||n[t]!==(n[t]=r)&&(t==="loading"&&(e[t_]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Mp(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function k_(e,t,r,i,n=!1,a=!1){if(ar&&n&&e.tagName==="INPUT"){var o=e,s=o.type==="checkbox"?"defaultChecked":"defaultValue";s in r||Ep(o)}var c=Ap(e),l=c[Sp],h=!c[Tp];let u=ar&&l;u&&un(!1);var f=t||{},d=e.tagName==="OPTION";for(var p in t)p in r||(r[p]=null);r.class?r.class=g_(r.class):r.class=null,r[da]&&(r.style??(r.style=null));var g=Mp(e);for(const w in r){let E=r[w];if(d&&w==="value"&&E==null){e.value=e.__value="",f[w]=E;continue}if(w==="class"){var b=e.namespaceURI==="http://www.w3.org/1999/xhtml";Ae(e,b,E,i,t==null?void 0:t[La],r[La]),f[w]=E,f[La]=r[La];continue}if(w==="style"){Di(e,E,t==null?void 0:t[da],r[da]),f[w]=E,f[da]=r[da];continue}var y=f[w];if(!(E===y&&!(E===void 0&&e.hasAttribute(w)))){f[w]=E;var x=w[0]+w[1];if(x!=="$$")if(x==="on"){const I={},Y="$$"+w;let q=w.slice(2);var C=f_(q);if(h_(q)&&(q=q.slice(0,-7),I.capture=!0),!C&&y){if(E!=null)continue;e.removeEventListener(q,f[Y],I),f[Y]=null}if(E!=null)if(C)e[`__${q}`]=E,Ur([q]);else{let F=function(z){f[w].call(this,z)};f[Y]=u_(q,e,F,I)}else C&&(e[`__${q}`]=void 0)}else if(w==="style")Ue(e,w,E);else if(w==="autofocus")n_(e,!!E);else if(!l&&(w==="__value"||w==="value"&&E!=null))e.value=e.__value=E;else if(w==="selected"&&d)__(e,E);else{var A=w;h||(A=d_(A));var B=A==="defaultValue"||A==="defaultChecked";if(E==null&&!l&&!B)if(c[w]=null,A==="value"||A==="checked"){let I=e;const Y=t===void 0;if(A==="value"){let q=I.defaultValue;I.removeAttribute(A),I.defaultValue=q,I.value=I.__value=Y?q:null}else{let q=I.defaultChecked;I.removeAttribute(A),I.defaultChecked=q,I.checked=Y?q:!1}}else e.removeAttribute(w);else B||g.includes(A)&&(l||typeof E!="string")?(e[A]=E,A in c&&(c[A]=a_)):typeof E!="function"&&Ue(e,A,E)}}}return u&&un(!0),f}function w_(e,t,r=[],i=[],n=[],a,o=!1,s=!1){r_(n,r,i,c=>{var l=void 0,h={},u=e.nodeName==="SELECT",f=!1;if(dp(()=>{var p=t(...c.map(v)),g=k_(e,l,p,a,o,s);f&&u&&"value"in p&&ho(e,p.value);for(let y of Object.getOwnPropertySymbols(h))p[y]||co(h[y]);for(let y of Object.getOwnPropertySymbols(p)){var b=p[y];y.description===i_&&(!l||b!==l[y])&&(h[y]&&co(h[y]),h[y]=Va(()=>v_(e,()=>b))),g[y]=b}l=g}),u){var d=e;Qo(()=>{ho(d,l.value,!0),Cp(d)})}f=!0})}function Ap(e){return e.__attributes??(e.__attributes={[Sp]:e.nodeName.includes("-"),[Tp]:e.namespaceURI===Kv})}var Zu=new Map;function Mp(e){var t=e.getAttribute("is")||e.nodeName,r=Zu.get(t);if(r)return r;Zu.set(t,r=[]);for(var i,n=e,a=Element.prototype;a!==n;){i=Jv(n);for(var o in i)i[o].set&&r.push(o);n=Qv(n)}return r}function C_(e,t,r=t){var i=new WeakSet;fp(e,"input",async n=>{var a=n?e.defaultValue:e.value;if(a=Dl(e)?Fl(a):a,r(a),Ci!==null&&i.add(Ci),await s_(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??"",s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(ar&&e.defaultValue!==e.value||gp(t)==null&&e.value)&&(r(Dl(e)?Fl(e.value):e.value),Ci!==null&&i.add(Ci)),o_(()=>{var n=t();if(e===document.activeElement){var a=pp??Ci;if(i.has(a))return}Dl(e)&&n===Fl(e.value)||e.type==="date"&&!n&&!e.value||n!==e.value&&(e.value=n??"")})}function Dl(e){var t=e.type;return t==="number"||t==="range"}function Fl(e){return e===""?null:+e}var S_=it('<option disabled class="svelte-1elxaub">Waiting for streams...</option>'),T_=it("<option> </option>"),E_=it('<option title="Show events from all sessions in the current project" class="svelte-1elxaub"> </option> <!>',1),A_=aa('<svg class="w-5 h-5 text-slate-300 svelte-1elxaub" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" class="svelte-1elxaub"></path></svg>'),M_=aa('<svg class="w-5 h-5 text-amber-500 svelte-1elxaub" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" class="svelte-1elxaub"></path></svg>'),L_=it('<div class="text-xs text-red-600 dark:text-red-400 max-w-xs truncate svelte-1elxaub"> </div>'),B_=it('<header class="bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-6 py-4 transition-colors svelte-1elxaub"><div class="flex items-center justify-between svelte-1elxaub"><div class="svelte-1elxaub"><h1 class="text-2xl font-bold text-slate-900 dark:text-white svelte-1elxaub">Claude MPM Monitor</h1> <p class="text-sm text-slate-700 dark:text-slate-300 mt-1 svelte-1elxaub">Real-time multi-agent orchestration dashboard</p></div> <div class="flex items-center gap-3 svelte-1elxaub"><div class="flex items-center gap-2 svelte-1elxaub"><label for="project-filter" class="text-sm text-slate-700 dark:text-slate-300 svelte-1elxaub">Project:</label> <select id="project-filter" class="px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 bg-slate-100 dark:bg-slate-700 border border-slate-300 dark:border-slate-600 rounded hover:bg-slate-200 dark:hover:bg-slate-600 focus:outline-none focus:ring-2 focus:ring-cyan-500 transition-colors svelte-1elxaub"><option class="svelte-1elxaub">Current Only</option><option class="svelte-1elxaub">All Projects</option></select></div> <div class="flex items-center gap-2 svelte-1elxaub"><label for="stream-filter" class="text-sm text-slate-700 dark:text-slate-300 svelte-1elxaub">Stream:</label> <select id="stream-filter" class="px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 bg-slate-100 dark:bg-slate-700 border border-slate-300 dark:border-slate-600 rounded hover:bg-slate-200 dark:hover:bg-slate-600 focus:outline-none focus:ring-2 focus:ring-cyan-500 transition-colors svelte-1elxaub"><!></select></div> <button class="p-2 bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-cyan-500 svelte-1elxaub"><!></button> <div class="flex items-center gap-2 svelte-1elxaub"><div></div> <span class="text-sm font-medium text-slate-900 dark:text-slate-100 svelte-1elxaub"> </span></div> <!></div></div></header>');function $_(e,t){Ir(t,!0);const r=()=>tn(y,"$projectFilter",c),i=()=>tn(b,"$currentWorkingDirectory",c),n=()=>tn(g,"$selectedStream",c),a=()=>tn(E,"$streamOptions",c),o=()=>tn(h,"$isConnected",c),s=()=>tn(u,"$error",c),[c,l]=vp(),{isConnected:h,error:u,streams:f,streamMetadata:d,streamActivity:p,selectedStream:g,currentWorkingDirectory:b,projectFilter:y}=Xn;let x=we(()=>In.current);const C=30*1e3;let A=ae(Bi(Date.now())),B=null;ir(()=>{if(typeof window<"u")return B=window.setInterval(()=>{et(A,Date.now(),!0)},1e3),()=>{B!==null&&window.clearInterval(B)}});function w(ot){const Ct=Math.floor((v(A)-ot)/1e3);if(Ct<60)return`${Ct}s ago`;const zt=Math.floor(Ct/60);return zt<60?`${zt}m ago`:`${Math.floor(zt/60)}h ago`}const E=Jo([f,d,p,b,y],([ot,Ct,zt,Ht,gt])=>{let Mt=Array.from(ot);return gt==="current"&&Ht&&(Mt=Mt.filter(kt=>{const St=Ct.get(kt);return(St==null?void 0:St.projectPath)===Ht})),Mt.map(kt=>{const St=Ct.get(kt),Tt=(St==null?void 0:St.projectName)||"Unknown Project",Et=zt.get(kt)||0,ht=v(A)-Et<C,Lt=Et>0?w(Et):"",fe=`${Tt} (${kt})`;return{id:kt,displayName:fe,projectPath:(St==null?void 0:St.projectPath)||null,isActive:ht,timeSince:Lt,lastActivity:Et}}).sort((kt,St)=>kt.isActive&&!St.isActive?-1:!kt.isActive&&St.isActive?1:St.lastActivity-kt.lastActivity)});var I=B_(),Y=$(I),q=H($(Y),2),F=$(q),z=H($(F),2);z.__change=()=>Xn.setProjectFilter(r());var D=$(z);D.value=D.__value="current";var _=H(D);_.value=_.__value="all",L(z),L(F);var T=H(F,2),k=H($(T),2),S=$(k);{var M=ot=>{var Ct=S_();Ct.value=Ct.__value="",Z(ot,Ct)},W=ot=>{var Ct=E_(),zt=Ee(Ct),Ht=$(zt);L(zt),zt.value=zt.__value="all-streams";var gt=H(zt,2);hr(gt,1,a,di,(Mt,kt)=>{var St=T_();let Tt;var Et=$(St);L(St);var ht={};xt(()=>{Ue(St,"title",v(kt).projectPath||v(kt).id),Tt=Ae(St,1,"svelte-1elxaub",null,Tt,{"active-stream":v(kt).isActive}),tt(Et,`${v(kt).isActive?"🟢":"⚪"} ${v(kt).displayName??""} ${v(kt).timeSince?`(${v(kt).timeSince})`:""}`),ht!==(ht=v(kt).id)&&(St.value=(St.__value=v(kt).id)??"")}),Z(Mt,St)}),xt(()=>tt(Ht,`🌐 All Streams (${a().length??""} active)`)),Z(ot,Ct)};mt(S,ot=>{a().length===0?ot(M):ot(W,!1)})}L(k),L(T);var N=H(T,2);N.__click=()=>In.toggle();var O=$(N);{var j=ot=>{var Ct=A_();Z(ot,Ct)},G=ot=>{var Ct=M_();Z(ot,Ct)};mt(O,ot=>{v(x)==="dark"?ot(j):ot(G,!1)})}L(N);var X=H(N,2),J=$(X);let K;var at=H(J,2),lt=$(at,!0);L(at),L(X);var wt=H(X,2);{var _t=ot=>{var Ct=L_(),zt=$(Ct);L(Ct),xt(()=>{Ue(Ct,"title",s()),tt(zt,`Error: ${s()??""}`)}),Z(ot,Ct)};mt(wt,ot=>{s()&&ot(_t)})}L(q),L(Y),L(I),xt(ot=>{Ue(z,"title",r()==="current"?`Showing only: ${i()}`:"Showing all projects"),Ue(k,"title",ot),k.disabled=a().length===0,Ue(N,"title",v(x)==="dark"?"Switch to light mode":"Switch to dark mode"),K=Ae(J,1,"w-3 h-3 rounded-full transition-colors svelte-1elxaub",null,K,{"bg-green-500":o(),"bg-red-500":!o()}),tt(lt,o()?"Connected":"Disconnected")},[()=>{var ot;return n()==="all-streams"?"Showing all streams for current project":((ot=a().find(Ct=>Ct.id===n()))==null?void 0:ot.projectPath)||""}]),Za(z,r,ot=>Vu(y,ot)),Za(k,n,ot=>Vu(g,ot)),Z(e,I),Dr(),l()}Ur(["change","click"]);var R_=it("<option> </option>"),O_=it('<div class="text-center py-12 text-slate-600 dark:text-slate-400"><svg class="w-16 h-16 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg> <p class="text-lg mb-2 font-medium">No events yet</p> <p class="text-sm text-slate-500 dark:text-slate-500">Waiting for Claude activity...</p></div>'),N_=it('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold bg-green-500/20 text-green-600 dark:text-green-400 border border-green-500/30"> </span>'),I_=it('<button><div><span> </span></div> <div class="text-slate-700 dark:text-slate-300 truncate font-mono text-[11px]"> </div> <div class="text-slate-700 dark:text-slate-300 truncate flex items-center gap-2"><span> </span> <!></div> <div class="text-slate-700 dark:text-slate-300 truncate"> </div> <div class="text-slate-700 dark:text-slate-300 font-mono text-[11px] text-right"> </div></button>'),D_=it('<div class="grid grid-cols-[110px_120px_160px_120px_100px] gap-3 px-4 py-2 bg-slate-50 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-700 text-xs font-semibold text-slate-700 dark:text-slate-300 sticky top-0 transition-colors"><div>Event</div> <div>Source</div> <div>Activity</div> <div>Agent</div> <div class="text-right">Timestamp</div></div> <div tabindex="0" role="list" aria-label="Event list - use arrow keys to navigate" class="focus:outline-none overflow-y-auto max-h-[calc(100vh-280px)]"></div>',1),F_=it('<div class="flex flex-col h-full bg-white dark:bg-slate-900"><div class="flex items-center justify-between px-6 py-3 bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><div class="flex items-center gap-3"><select class="px-3 py-1 text-xs font-medium bg-white dark:bg-slate-700 hover:bg-slate-50 dark:hover:bg-slate-600 rounded transition-colors border border-slate-300 dark:border-slate-600 text-slate-900 dark:text-slate-200"><option>All Activities</option><!></select></div> <div class="flex items-center gap-3"><span class="text-sm text-slate-700 dark:text-slate-300"> </span> <button class="px-3 py-1 text-xs font-medium bg-white dark:bg-slate-700 hover:bg-slate-50 dark:hover:bg-slate-600 rounded transition-colors border border-slate-300 dark:border-slate-600 text-slate-900 dark:text-slate-200">Clear</button></div></div> <div class="flex-1 overflow-y-auto"><!></div></div>');function P_(e,t){Ir(t,!0);let r=We(t,"selectedEvent",15,null),i=We(t,"selectedStream",3,"");const{events:n}=Xn;let a=ae(Bi([]));ir(()=>n.subscribe(O=>{et(a,O,!0)}));let o=ae(null),s=ae(!0);function c(N,O=100){const{scrollTop:j,scrollHeight:G,clientHeight:X}=N;return G-j-X<O}ir(()=>{v(u).length>0&&v(o)&&(v(s)||c(v(o)))&&setTimeout(()=>{v(o)&&(v(o).scrollTop=v(o).scrollHeight,et(s,!1))},0)}),ir(()=>{i(),et(s,!0)});let l=ae(""),h=we(()=>i()===""||i()==="all-streams"?v(a):v(a).filter(N=>{const O=N.data,j=O&&typeof O=="object"&&!Array.isArray(O)?O.session_id||O.sessionId:null;return(N.session_id||N.sessionId||j||N.source)===i()})),u=we(()=>v(l)?v(h).filter(N=>N.subtype===v(l)):v(h)),f=we(()=>Array.from(new Set(v(h).map(N=>N.subtype).filter(Boolean))).sort());function d(N){return new Date(N).toLocaleTimeString()}function p(N){switch(N){case"tool_call":return"text-blue-400";case"tool_result":return"text-green-400";case"message":return"text-purple-400";case"error":return"text-red-400";default:return"text-slate-400"}}function g(){Xn.clearEvents(),r(null)}function b(N){r(N)}function y(N){var G;if(v(u).length===0)return;const O=r()?v(u).findIndex(X=>{var J;return X.id===((J=r())==null?void 0:J.id)}):-1;let j=O;if(N.key==="ArrowDown")N.preventDefault(),j=O<v(u).length-1?O+1:O;else if(N.key==="ArrowUp")N.preventDefault(),j=O>0?O-1:0;else return;if(j!==O&&j>=0&&j<v(u).length){r(v(u)[j]);const X=(G=v(o))==null?void 0:G.querySelector(`[data-event-id="${r().id}"]`);X&&X.scrollIntoView({block:"nearest",behavior:"smooth"})}}function x(N){const O=N.data,j=O&&typeof O=="object"&&!Array.isArray(O)?O.session_id||O.sessionId:null,G=N.session_id||N.sessionId||j||N.source;return G?G.toString().slice(0,12):"-"}function C(N){if(N.subtype&&N.subtype!=="claude_event")return N.subtype;if(typeof N.data=="object"&&N.data!==null){const O=N.data;if(O.event_type)return String(O.event_type);if(O.activity)return String(O.activity);if(O.type&&String(O.type)!=="claude_event")return String(O.type);if(O.action)return String(O.action)}return N.type&&N.type!=="claude_event"?N.type:N.event&&N.event!=="claude_event"?N.event:"-"}function A(N){var O;if(N.subtype==="user_prompt"||N.subtype==="UserPromptSubmit"||(O=N.subtype)!=null&&O.toLowerCase().includes("user"))return"user";if(typeof N.data=="object"&&N.data!==null){const j=N.data;if(j.agent_type)return String(j.agent_type);if(j.agent)return String(j.agent);if(j.tool_name)return String(j.tool_name);if(j.source)return String(j.source);if(j.sender)return String(j.sender);if(j.role)return String(j.role)}return"-"}function B(N){if(N.subtype!=="post_tool"||!N.correlation_id)return null;const O=v(a).find(J=>J.correlation_id===N.correlation_id&&J.subtype==="pre_tool");if(!O)return null;const j=typeof N.timestamp=="string"?new Date(N.timestamp).getTime():N.timestamp,G=typeof O.timestamp=="string"?new Date(O.timestamp).getTime():O.timestamp,X=j-G;if(X<1e3)return`${X}ms`;if(X<6e4)return`${(X/1e3).toFixed(2)}s`;{const J=Math.floor(X/6e4),K=(X%6e4/1e3).toFixed(0);return`${J}m ${K}s`}}var w=F_(),E=$(w),I=$(E),Y=$(I),q=$(Y);q.value=q.__value="";var F=H(q);hr(F,17,()=>v(f),di,(N,O)=>{var j=R_(),G=$(j,!0);L(j);var X={};xt(()=>{tt(G,v(O)),X!==(X=v(O))&&(j.value=(j.__value=v(O))??"")}),Z(N,j)}),L(Y),L(I);var z=H(I,2),D=$(z),_=$(D);L(D);var T=H(D,2);T.__click=g,L(z),L(E);var k=H(E,2),S=$(k);{var M=N=>{var O=O_();Z(N,O)},W=N=>{var O=D_(),j=H(Ee(O),2);j.__keydown=y,hr(j,23,()=>v(u),G=>G.id,(G,X,J)=>{var K=I_();K.__click=()=>b(v(X));var at=$(K),lt=$(at),wt=$(lt,!0);L(lt),L(at);var _t=H(at,2),ot=$(_t,!0);L(_t);var Ct=H(_t,2),zt=$(Ct),Ht=$(zt,!0);L(zt);var gt=H(zt,2);{var Mt=ht=>{var Lt=N_(),fe=$(Lt);L(Lt),xt(oe=>tt(fe,`→ ${oe??""}`),[()=>B(v(X))]),Z(ht,Lt)};mt(gt,ht=>{B(v(X))&&ht(Mt)})}L(Ct);var kt=H(Ct,2),St=$(kt,!0);L(kt);var Tt=H(kt,2),Et=$(Tt,!0);L(Tt),L(K),xt((ht,Lt,fe,oe,me)=>{var ee;Ue(K,"data-event-id",v(X).id),Ae(K,1,`w-full text-left px-4 py-2.5 transition-colors border-l-4 grid grid-cols-[110px_120px_160px_120px_100px] gap-3 items-center text-xs
|
|
3
|
+
${((ee=r())==null?void 0:ee.id)===v(X).id?"bg-cyan-50 dark:bg-cyan-500/20 border-l-cyan-500 dark:border-l-cyan-400 ring-1 ring-cyan-300 dark:ring-cyan-500/30":`border-l-transparent ${v(J)%2===0?"bg-slate-50 dark:bg-slate-800/40":"bg-white dark:bg-slate-800/20"} hover:bg-slate-100 dark:hover:bg-slate-700/30`}`),Ae(lt,1,`font-mono px-2 py-0.5 rounded-md bg-slate-100 dark:bg-black/30 ${ht??""} font-medium text-[11px]`),tt(wt,v(X).event||v(X).type),tt(ot,Lt),tt(Ht,fe),tt(St,oe),tt(Et,me)},[()=>p(v(X).type),()=>x(v(X)),()=>C(v(X)),()=>A(v(X)),()=>d(v(X).timestamp)]),Z(G,K)}),L(j),Xa(j,G=>et(o,G),()=>v(o)),Z(N,O)};mt(S,N=>{v(u).length===0?N(M):N(W,!1)})}L(k),L(w),xt(()=>tt(_,`${v(u).length??""} events`)),Za(Y,()=>v(l),N=>et(l,N)),Z(e,w),Dr()}Ur(["click","keydown"]);var z_=it("<option> </option>"),W_=it('<div class="text-center py-12 text-slate-600 dark:text-slate-400"><svg class="w-16 h-16 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <p class="text-lg mb-2 font-medium">No tool executions yet</p> <p class="text-sm text-slate-500 dark:text-slate-500">Waiting for Claude to use tools...</p></div>'),q_=it('<button><div><span class="font-mono px-2 py-0.5 rounded-md bg-slate-100 dark:bg-black/30 text-blue-600 dark:text-blue-400 font-medium text-[11px]"> </span></div> <div class="text-slate-700 dark:text-slate-300 truncate"> </div> <div class="text-center"><span> </span></div> <div class="text-slate-700 dark:text-slate-300 font-mono text-[11px] text-right"> </div></button>'),H_=it('<div class="grid grid-cols-[140px_1fr_80px_100px] gap-3 px-4 py-2 bg-slate-50 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-700 text-xs font-semibold text-slate-700 dark:text-slate-300 sticky top-0 transition-colors"><div>Tool Name</div> <div>Operation</div> <div class="text-center">Status</div> <div class="text-right">Duration</div></div> <div tabindex="0" role="list" aria-label="Tool list - use arrow keys to navigate" class="focus:outline-none overflow-y-auto max-h-[calc(100vh-280px)]"></div>',1),j_=it('<div class="flex flex-col h-full bg-white dark:bg-slate-900"><div class="flex items-center justify-between px-6 py-3 bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><div class="flex items-center gap-3"><select class="px-3 py-1 text-xs font-medium bg-white dark:bg-slate-700 hover:bg-slate-50 dark:hover:bg-slate-600 rounded transition-colors border border-slate-300 dark:border-slate-600 text-slate-900 dark:text-slate-200"><option>All Tools</option><!></select></div> <span class="text-sm text-slate-700 dark:text-slate-300"> </span></div> <div class="flex-1 overflow-y-auto"><!></div></div>');function U_(e,t){Ir(t,!0);let r=We(t,"selectedTool",15,null),i=We(t,"selectedStream",3,"");ir(()=>{console.log("[ToolsView] Props received:",{toolsLength:t.tools.length,selectedStream:i(),firstTool:t.tools[0]?{id:t.tools[0].id,name:t.tools[0].toolName}:null})});let n=we(()=>{const z=i()===""?t.tools:t.tools.filter(D=>{const _=D.preToolEvent,T=_.data;return(_.session_id||_.sessionId||(T==null?void 0:T.session_id)||_.source)===i()});return console.log("[ToolsView] Filtered tools:",{inputLength:t.tools.length,outputLength:z.length,selectedStream:i()}),z}),a=ae(null),o=ae(!0);function s(z,D=100){const{scrollTop:_,scrollHeight:T,clientHeight:k}=z;return T-_-k<D}ir(()=>{v(l).length>0&&v(a)&&(v(o)||s(v(a)))&&setTimeout(()=>{v(a)&&(v(a).scrollTop=v(a).scrollHeight,et(o,!1))},0)}),ir(()=>{i(),et(o,!0)});let c=ae(""),l=we(()=>v(c)?v(n).filter(z=>z.toolName===v(c)):v(n)),h=we(()=>Array.from(new Set(v(n).map(z=>z.toolName))).sort());function u(z){r(z)}function f(z){if(z===null)return"—";if(z<1e3)return`${z}ms`;if(z<6e4)return`${(z/1e3).toFixed(2)}s`;{const D=Math.floor(z/6e4),_=(z%6e4/1e3).toFixed(0);return`${D}m ${_}s`}}function d(z){switch(z){case"pending":return"⏳";case"success":return"✅";case"error":return"❌";default:return"❓"}}function p(z){switch(z){case"pending":return"text-yellow-600 dark:text-yellow-400";case"success":return"text-green-600 dark:text-green-400";case"error":return"text-red-600 dark:text-red-400";default:return"text-slate-600 dark:text-slate-400"}}function g(z){var T;if(v(l).length===0)return;const D=r()?v(l).findIndex(k=>{var S;return k.id===((S=r())==null?void 0:S.id)}):-1;let _=D;if(z.key==="ArrowDown")z.preventDefault(),_=D<v(l).length-1?D+1:D;else if(z.key==="ArrowUp")z.preventDefault(),_=D>0?D-1:0;else return;if(_!==D&&_>=0&&_<v(l).length){r(v(l)[_]);const k=(T=v(a))==null?void 0:T.querySelector(`[data-tool-id="${r().id}"]`);k&&k.scrollIntoView({block:"nearest",behavior:"smooth"})}}var b=j_(),y=$(b),x=$(y),C=$(x),A=$(C);A.value=A.__value="";var B=H(A);hr(B,17,()=>v(h),di,(z,D)=>{var _=z_(),T=$(_,!0);L(_);var k={};xt(()=>{tt(T,v(D)),k!==(k=v(D))&&(_.value=(_.__value=v(D))??"")}),Z(z,_)}),L(C),L(x);var w=H(x,2),E=$(w);L(w),L(y);var I=H(y,2),Y=$(I);{var q=z=>{var D=W_();Z(z,D)},F=z=>{var D=H_(),_=H(Ee(D),2);_.__keydown=g,hr(_,23,()=>v(l),T=>T.id,(T,k,S)=>{var M=q_();M.__click=()=>u(v(k));var W=$(M),N=$(W),O=$(N,!0);L(N),L(W);var j=H(W,2),G=$(j,!0);L(j);var X=H(j,2),J=$(X),K=$(J,!0);L(J),L(X);var at=H(X,2),lt=$(at,!0);L(at),L(M),xt((wt,_t,ot)=>{var Ct;Ue(M,"data-tool-id",v(k).id),Ae(M,1,`w-full text-left px-4 py-2.5 transition-colors border-l-4 grid grid-cols-[140px_1fr_80px_100px] gap-3 items-center text-xs
|
|
4
|
+
${((Ct=r())==null?void 0:Ct.id)===v(k).id?"bg-cyan-50 dark:bg-cyan-500/20 border-l-cyan-500 dark:border-l-cyan-400 ring-1 ring-cyan-300 dark:ring-cyan-500/30":`border-l-transparent ${v(S)%2===0?"bg-slate-50 dark:bg-slate-800/40":"bg-white dark:bg-slate-800/20"} hover:bg-slate-100 dark:hover:bg-slate-700/30`}`),tt(O,v(k).toolName),tt(G,v(k).operation),Ae(J,1,`${wt??""} text-base`),tt(K,_t),tt(lt,ot)},[()=>p(v(k).status),()=>d(v(k).status),()=>f(v(k).duration)]),Z(T,M)}),L(_),Xa(_,T=>et(a,T),()=>v(a)),Z(z,D)};mt(Y,z=>{v(l).length===0?z(q):z(F,!1)})}L(I),L(b),xt(()=>tt(E,`${v(l).length??""} tools`)),Za(C,()=>v(c),z=>et(c,z)),Z(e,b),Dr()}Ur(["keydown","click"]);async function Ku(e){try{const t=await fetch(`/api/file/read?path=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Failed to fetch file: ${t.statusText}`);const r=await t.json();if(r.error)throw new Error(r.error);return r.content||""}catch(t){throw console.error("[files.svelte.ts] Error fetching file content:",t),t}}function Qu(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(t.file_path&&typeof t.file_path=="string")return t.file_path;const r=t.tool_parameters;if(r&&typeof r=="object"&&!Array.isArray(r)){const i=r;if(i.file_path&&typeof i.file_path=="string")return i.file_path}return null}function Ju(e){switch(e.toLowerCase()){case"read":return"read";case"write":return"write";case"edit":case"multiedit":return"edit";default:return null}}function G_(e){return e.split("/").filter(Boolean).pop()||e}function Y_(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const r=e.tool_parameters;if(!r||typeof r!="object"||Array.isArray(r))return{};const i=r,n={};return i.content&&typeof i.content=="string"?n.newContent=i.content:i.new_string&&typeof i.new_string=="string"&&(n.newContent=i.new_string),i.old_string&&typeof i.old_string=="string"&&(n.oldContent=i.old_string),n}function V_(e,t){const r=e.split(`
|
|
5
|
+
`),i=t.split(`
|
|
6
|
+
`),n=[];Math.max(r.length,i.length);let a=0,o=0;for(;a<r.length||o<i.length;){const s=r[a],c=i[o];if(a>=r.length)n.push({type:"add",content:c,lineNumber:o+1}),o++;else if(o>=i.length)n.push({type:"remove",content:s}),a++;else if(s===c)n.push({type:"context",content:s,lineNumber:o+1}),a++,o++;else{const l=a+1<r.length&&r[a+1]===c,h=o+1<i.length&&i[o+1]===s;l&&!h?(n.push({type:"remove",content:s}),a++):h&&!l?(n.push({type:"add",content:c,lineNumber:o+1}),o++):(n.push({type:"remove",content:s}),n.push({type:"add",content:c,lineNumber:o+1}),a++,o++)}}return n}var X_={value:()=>{}};function wh(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Us(r)}function Us(e){this._=e}function Z_(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",n=r.indexOf(".");if(n>=0&&(i=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Us.prototype=wh.prototype={constructor:Us,on:function(e,t){var r=this._,i=Z_(e+"",r),n,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((n=(e=i[a]).type)&&(n=K_(r[n],e.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(n=(e=i[a]).type)r[n]=td(r[n],e.name,t);else if(t==null)for(n in r)r[n]=td(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Us(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var r=new Array(n),i=0,n,a;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,n=a.length;i<n;++i)a[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],n=0,a=i.length;n<a;++n)i[n].value.apply(t,r)}};function K_(e,t){for(var r=0,i=e.length,n;r<i;++r)if((n=e[r]).name===t)return n.value}function td(e,t,r){for(var i=0,n=e.length;i<n;++i)if(e[i].name===t){e[i]=X_,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var fc="http://www.w3.org/1999/xhtml";const ed={svg:"http://www.w3.org/2000/svg",xhtml:fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function el(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),ed.hasOwnProperty(t)?{space:ed[t],local:e}:e}function Q_(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===fc&&t.documentElement.namespaceURI===fc?t.createElement(e):t.createElementNS(r,e)}}function J_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Lp(e){var t=el(e);return(t.local?J_:Q_)(t)}function t1(){}function Ch(e){return e==null?t1:function(){return this.querySelector(e)}}function e1(e){typeof e!="function"&&(e=Ch(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=new Array(o),c,l,h=0;h<o;++h)(c=a[h])&&(l=e.call(c,c.__data__,h,a))&&("__data__"in c&&(l.__data__=c.__data__),s[h]=l);return new Nr(i,this._parents)}function r1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function i1(){return[]}function Bp(e){return e==null?i1:function(){return this.querySelectorAll(e)}}function n1(e){return function(){return r1(e.apply(this,arguments))}}function a1(e){typeof e=="function"?e=n1(e):e=Bp(e);for(var t=this._groups,r=t.length,i=[],n=[],a=0;a<r;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(i.push(e.call(c,c.__data__,l,o)),n.push(c));return new Nr(i,n)}function $p(e){return function(){return this.matches(e)}}function Rp(e){return function(t){return t.matches(e)}}var s1=Array.prototype.find;function o1(e){return function(){return s1.call(this.children,e)}}function l1(){return this.firstElementChild}function c1(e){return this.select(e==null?l1:o1(typeof e=="function"?e:Rp(e)))}var h1=Array.prototype.filter;function u1(){return Array.from(this.children)}function d1(e){return function(){return h1.call(this.children,e)}}function f1(e){return this.selectAll(e==null?u1:d1(typeof e=="function"?e:Rp(e)))}function p1(e){typeof e!="function"&&(e=$p(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Nr(i,this._parents)}function Op(e){return new Array(e.length)}function g1(){return new Nr(this._enter||this._groups.map(Op),this._parents)}function uo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}uo.prototype={constructor:uo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function m1(e){return function(){return e}}function b1(e,t,r,i,n,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],i[o]=s):r[o]=new uo(e,a[o]);for(;o<c;++o)(s=t[o])&&(n[o]=s)}function y1(e,t,r,i,n,a,o){var s,c,l=new Map,h=t.length,u=a.length,f=new Array(h),d;for(s=0;s<h;++s)(c=t[s])&&(f[s]=d=o.call(c,c.__data__,s,t)+"",l.has(d)?n[s]=c:l.set(d,c));for(s=0;s<u;++s)d=o.call(e,a[s],s,a)+"",(c=l.get(d))?(i[s]=c,c.__data__=a[s],l.delete(d)):r[s]=new uo(e,a[s]);for(s=0;s<h;++s)(c=t[s])&&l.get(f[s])===c&&(n[s]=c)}function x1(e){return e.__data__}function v1(e,t){if(!arguments.length)return Array.from(this,x1);var r=t?y1:b1,i=this._parents,n=this._groups;typeof e!="function"&&(e=m1(e));for(var a=n.length,o=new Array(a),s=new Array(a),c=new Array(a),l=0;l<a;++l){var h=i[l],u=n[l],f=u.length,d=_1(e.call(h,h&&h.__data__,l,i)),p=d.length,g=s[l]=new Array(p),b=o[l]=new Array(p),y=c[l]=new Array(f);r(h,u,g,b,y,d,t);for(var x=0,C=0,A,B;x<p;++x)if(A=g[x]){for(x>=C&&(C=x+1);!(B=b[C])&&++C<p;);A._next=B||null}}return o=new Nr(o,i),o._enter=s,o._exit=c,o}function _1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function k1(){return new Nr(this._exit||this._groups.map(Op),this._parents)}function w1(e,t,r){var i=this.enter(),n=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(n=t(n),n&&(n=n.selection())),r==null?a.remove():r(a),i&&n?i.merge(n).order():n}function C1(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,n=r.length,a=i.length,o=Math.min(n,a),s=new Array(n),c=0;c<o;++c)for(var l=r[c],h=i[c],u=l.length,f=s[c]=new Array(u),d,p=0;p<u;++p)(d=l[p]||h[p])&&(f[p]=d);for(;c<n;++c)s[c]=r[c];return new Nr(s,this._parents)}function S1(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],n=i.length-1,a=i[n],o;--n>=0;)(o=i[n])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function T1(e){e||(e=E1);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var r=this._groups,i=r.length,n=new Array(i),a=0;a<i;++a){for(var o=r[a],s=o.length,c=n[a]=new Array(s),l,h=0;h<s;++h)(l=o[h])&&(c[h]=l);c.sort(t)}return new Nr(n,this._parents).order()}function E1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function A1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function M1(){return Array.from(this)}function L1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,a=i.length;n<a;++n){var o=i[n];if(o)return o}return null}function B1(){let e=0;for(const t of this)++e;return e}function $1(){return!this.node()}function R1(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var n=t[r],a=0,o=n.length,s;a<o;++a)(s=n[a])&&e.call(s,s.__data__,a,n);return this}function O1(e){return function(){this.removeAttribute(e)}}function N1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function I1(e,t){return function(){this.setAttribute(e,t)}}function D1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function F1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function P1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function z1(e,t){var r=el(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?N1:O1:typeof t=="function"?r.local?P1:F1:r.local?D1:I1)(r,t))}function Np(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function W1(e){return function(){this.style.removeProperty(e)}}function q1(e,t,r){return function(){this.style.setProperty(e,t,r)}}function H1(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function j1(e,t,r){return arguments.length>1?this.each((t==null?W1:typeof t=="function"?H1:q1)(e,t,r??"")):Zn(this.node(),e)}function Zn(e,t){return e.style.getPropertyValue(t)||Np(e).getComputedStyle(e,null).getPropertyValue(t)}function U1(e){return function(){delete this[e]}}function G1(e,t){return function(){this[e]=t}}function Y1(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function V1(e,t){return arguments.length>1?this.each((t==null?U1:typeof t=="function"?Y1:G1)(e,t)):this.node()[e]}function Ip(e){return e.trim().split(/^|\s+/)}function Sh(e){return e.classList||new Dp(e)}function Dp(e){this._node=e,this._names=Ip(e.getAttribute("class")||"")}Dp.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Fp(e,t){for(var r=Sh(e),i=-1,n=t.length;++i<n;)r.add(t[i])}function Pp(e,t){for(var r=Sh(e),i=-1,n=t.length;++i<n;)r.remove(t[i])}function X1(e){return function(){Fp(this,e)}}function Z1(e){return function(){Pp(this,e)}}function K1(e,t){return function(){(t.apply(this,arguments)?Fp:Pp)(this,e)}}function Q1(e,t){var r=Ip(e+"");if(arguments.length<2){for(var i=Sh(this.node()),n=-1,a=r.length;++n<a;)if(!i.contains(r[n]))return!1;return!0}return this.each((typeof t=="function"?K1:t?X1:Z1)(r,t))}function J1(){this.textContent=""}function tk(e){return function(){this.textContent=e}}function ek(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function rk(e){return arguments.length?this.each(e==null?J1:(typeof e=="function"?ek:tk)(e)):this.node().textContent}function ik(){this.innerHTML=""}function nk(e){return function(){this.innerHTML=e}}function ak(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function sk(e){return arguments.length?this.each(e==null?ik:(typeof e=="function"?ak:nk)(e)):this.node().innerHTML}function ok(){this.nextSibling&&this.parentNode.appendChild(this)}function lk(){return this.each(ok)}function ck(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hk(){return this.each(ck)}function uk(e){var t=typeof e=="function"?e:Lp(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dk(){return null}function fk(e,t){var r=typeof e=="function"?e:Lp(e),i=t==null?dk:typeof t=="function"?t:Ch(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function pk(){var e=this.parentNode;e&&e.removeChild(this)}function gk(){return this.each(pk)}function mk(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bk(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yk(e){return this.select(e?bk:mk)}function xk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vk(e){return function(t){e.call(this,t,this.__data__)}}function _k(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function kk(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,n=t.length,a;r<n;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function wk(e,t,r){return function(){var i=this.__on,n,a=vk(t);if(i){for(var o=0,s=i.length;o<s;++o)if((n=i[o]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=r),n.value=t;return}}this.addEventListener(e.type,a,r),n={type:e.type,name:e.name,value:t,listener:a,options:r},i?i.push(n):this.__on=[n]}}function Ck(e,t,r){var i=_k(e+""),n,a=i.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,h;c<l;++c)for(n=0,h=s[c];n<a;++n)if((o=i[n]).type===h.type&&o.name===h.name)return h.value}return}for(s=t?wk:kk,n=0;n<a;++n)this.each(s(i[n],t,r));return this}function zp(e,t,r){var i=Np(e),n=i.CustomEvent;typeof n=="function"?n=new n(t,r):(n=i.document.createEvent("Event"),r?(n.initEvent(t,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(t,!1,!1)),e.dispatchEvent(n)}function Sk(e,t){return function(){return zp(this,e,t)}}function Tk(e,t){return function(){return zp(this,e,t.apply(this,arguments))}}function Ek(e,t){return this.each((typeof t=="function"?Tk:Sk)(e,t))}function*Ak(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,a=i.length,o;n<a;++n)(o=i[n])&&(yield o)}var Wp=[null];function Nr(e,t){this._groups=e,this._parents=t}function us(){return new Nr([[document.documentElement]],Wp)}function Mk(){return this}Nr.prototype=us.prototype={constructor:Nr,select:e1,selectAll:a1,selectChild:c1,selectChildren:f1,filter:p1,data:v1,enter:g1,exit:k1,join:w1,merge:C1,selection:Mk,order:S1,sort:T1,call:A1,nodes:M1,node:L1,size:B1,empty:$1,each:R1,attr:z1,style:j1,property:V1,classed:Q1,text:rk,html:sk,raise:lk,lower:hk,append:uk,insert:fk,remove:gk,clone:yk,datum:xk,on:Ck,dispatch:Ek,[Symbol.iterator]:Ak};function se(e){return typeof e=="string"?new Nr([[document.querySelector(e)]],[document.documentElement]):new Nr([[e]],Wp)}function Lk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ki(e,t){if(e=Lk(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var n=t.getBoundingClientRect();return[e.clientX-n.left-t.clientLeft,e.clientY-n.top-t.clientTop]}}return[e.pageX,e.pageY]}const pc={capture:!0,passive:!1};function gc(e){e.preventDefault(),e.stopImmediatePropagation()}function Bk(e){var t=e.document.documentElement,r=se(e).on("dragstart.drag",gc,pc);"onselectstart"in t?r.on("selectstart.drag",gc,pc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $k(e,t){var r=e.document.documentElement,i=se(e).on("dragstart.drag",null);t&&(i.on("click.drag",gc,pc),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Th(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function qp(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function ds(){}var Ka=.7,fo=1/Ka,Dn="\\s*([+-]?\\d+)\\s*",Qa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rk=/^#([0-9a-f]{3,8})$/,Ok=new RegExp(`^rgb\\(${Dn},${Dn},${Dn}\\)$`),Nk=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),Ik=new RegExp(`^rgba\\(${Dn},${Dn},${Dn},${Qa}\\)$`),Dk=new RegExp(`^rgba\\(${fi},${fi},${fi},${Qa}\\)$`),Fk=new RegExp(`^hsl\\(${Qa},${fi},${fi}\\)$`),Pk=new RegExp(`^hsla\\(${Qa},${fi},${fi},${Qa}\\)$`),rd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Th(ds,Ja,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:id,formatHex:id,formatHex8:zk,formatHsl:Wk,formatRgb:nd,toString:nd});function id(){return this.rgb().formatHex()}function zk(){return this.rgb().formatHex8()}function Wk(){return Hp(this).formatHsl()}function nd(){return this.rgb().formatRgb()}function Ja(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Rk.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?ad(t):r===3?new Br(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Cs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Cs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Ok.exec(e))?new Br(t[1],t[2],t[3],1):(t=Nk.exec(e))?new Br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ik.exec(e))?Cs(t[1],t[2],t[3],t[4]):(t=Dk.exec(e))?Cs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fk.exec(e))?ld(t[1],t[2]/100,t[3]/100,1):(t=Pk.exec(e))?ld(t[1],t[2]/100,t[3]/100,t[4]):rd.hasOwnProperty(e)?ad(rd[e]):e==="transparent"?new Br(NaN,NaN,NaN,0):null}function ad(e){return new Br(e>>16&255,e>>8&255,e&255,1)}function Cs(e,t,r,i){return i<=0&&(e=t=r=NaN),new Br(e,t,r,i)}function qk(e){return e instanceof ds||(e=Ja(e)),e?(e=e.rgb(),new Br(e.r,e.g,e.b,e.opacity)):new Br}function mc(e,t,r,i){return arguments.length===1?qk(e):new Br(e,t,r,i??1)}function Br(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Th(Br,mc,qp(ds,{brighter(e){return e=e==null?fo:Math.pow(fo,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ka:Math.pow(Ka,e),new Br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Br(dn(this.r),dn(this.g),dn(this.b),po(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sd,formatHex:sd,formatHex8:Hk,formatRgb:od,toString:od}));function sd(){return`#${sn(this.r)}${sn(this.g)}${sn(this.b)}`}function Hk(){return`#${sn(this.r)}${sn(this.g)}${sn(this.b)}${sn((isNaN(this.opacity)?1:this.opacity)*255)}`}function od(){const e=po(this.opacity);return`${e===1?"rgb(":"rgba("}${dn(this.r)}, ${dn(this.g)}, ${dn(this.b)}${e===1?")":`, ${e})`}`}function po(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sn(e){return e=dn(e),(e<16?"0":"")+e.toString(16)}function ld(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Qr(e,t,r,i)}function Hp(e){if(e instanceof Qr)return new Qr(e.h,e.s,e.l,e.opacity);if(e instanceof ds||(e=Ja(e)),!e)return new Qr;if(e instanceof Qr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),a=Math.max(t,r,i),o=NaN,s=a-n,c=(a+n)/2;return s?(t===a?o=(r-i)/s+(r<i)*6:r===a?o=(i-t)/s+2:o=(t-r)/s+4,s/=c<.5?a+n:2-a-n,o*=60):s=c>0&&c<1?0:o,new Qr(o,s,c,e.opacity)}function jk(e,t,r,i){return arguments.length===1?Hp(e):new Qr(e,t,r,i??1)}function Qr(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Th(Qr,jk,qp(ds,{brighter(e){return e=e==null?fo:Math.pow(fo,e),new Qr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ka:Math.pow(Ka,e),new Qr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new Br(Pl(e>=240?e-240:e+120,n,i),Pl(e,n,i),Pl(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new Qr(cd(this.h),Ss(this.s),Ss(this.l),po(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=po(this.opacity);return`${e===1?"hsl(":"hsla("}${cd(this.h)}, ${Ss(this.s)*100}%, ${Ss(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cd(e){return e=(e||0)%360,e<0?e+360:e}function Ss(e){return Math.max(0,Math.min(1,e||0))}function Pl(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Eh=e=>()=>e;function jp(e,t){return function(r){return e+r*t}}function Uk(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function hD(e,t){var r=t-e;return r?jp(e,r>180||r<-180?r-360*Math.round(r/360):r):Eh(isNaN(e)?t:e)}function Gk(e){return(e=+e)==1?Up:function(t,r){return r-t?Uk(t,r,e):Eh(isNaN(t)?r:t)}}function Up(e,t){var r=t-e;return r?jp(e,r):Eh(isNaN(e)?t:e)}const hd=(function e(t){var r=Gk(t);function i(n,a){var o=r((n=mc(n)).r,(a=mc(a)).r),s=r(n.g,a.g),c=r(n.b,a.b),l=Up(n.opacity,a.opacity);return function(h){return n.r=o(h),n.g=s(h),n.b=c(h),n.opacity=l(h),n+""}}return i.gamma=e,i})(1);function Ni(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var bc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zl=new RegExp(bc.source,"g");function Yk(e){return function(){return e}}function Vk(e){return function(t){return e(t)+""}}function Xk(e,t){var r=bc.lastIndex=zl.lastIndex=0,i,n,a,o=-1,s=[],c=[];for(e=e+"",t=t+"";(i=bc.exec(e))&&(n=zl.exec(t));)(a=n.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:Ni(i,n)})),r=zl.lastIndex;return r<t.length&&(a=t.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Vk(c[0].x):Yk(t):(t=c.length,function(l){for(var h=0,u;h<t;++h)s[(u=c[h]).i]=u.x(l);return s.join("")})}var ud=180/Math.PI,yc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gp(e,t,r,i,n,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*r+t*i)&&(r-=e*c,i-=t*c),(s=Math.sqrt(r*r+i*i))&&(r/=s,i/=s,c/=s),e*i<t*r&&(e=-e,t=-t,c=-c,o=-o),{translateX:n,translateY:a,rotate:Math.atan2(t,e)*ud,skewX:Math.atan(c)*ud,scaleX:o,scaleY:s}}var Ts;function Zk(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yc:Gp(t.a,t.b,t.c,t.d,t.e,t.f)}function Kk(e){return e==null||(Ts||(Ts=document.createElementNS("http://www.w3.org/2000/svg","g")),Ts.setAttribute("transform",e),!(e=Ts.transform.baseVal.consolidate()))?yc:(e=e.matrix,Gp(e.a,e.b,e.c,e.d,e.e,e.f))}function Yp(e,t,r,i){function n(l){return l.length?l.pop()+" ":""}function a(l,h,u,f,d,p){if(l!==u||h!==f){var g=d.push("translate(",null,t,null,r);p.push({i:g-4,x:Ni(l,u)},{i:g-2,x:Ni(h,f)})}else(u||f)&&d.push("translate("+u+t+f+r)}function o(l,h,u,f){l!==h?(l-h>180?h+=360:h-l>180&&(l+=360),f.push({i:u.push(n(u)+"rotate(",null,i)-2,x:Ni(l,h)})):h&&u.push(n(u)+"rotate("+h+i)}function s(l,h,u,f){l!==h?f.push({i:u.push(n(u)+"skewX(",null,i)-2,x:Ni(l,h)}):h&&u.push(n(u)+"skewX("+h+i)}function c(l,h,u,f,d,p){if(l!==u||h!==f){var g=d.push(n(d)+"scale(",null,",",null,")");p.push({i:g-4,x:Ni(l,u)},{i:g-2,x:Ni(h,f)})}else(u!==1||f!==1)&&d.push(n(d)+"scale("+u+","+f+")")}return function(l,h){var u=[],f=[];return l=e(l),h=e(h),a(l.translateX,l.translateY,h.translateX,h.translateY,u,f),o(l.rotate,h.rotate,u,f),s(l.skewX,h.skewX,u,f),c(l.scaleX,l.scaleY,h.scaleX,h.scaleY,u,f),l=h=null,function(d){for(var p=-1,g=f.length,b;++p<g;)u[(b=f[p]).i]=b.x(d);return u.join("")}}}var Qk=Yp(Zk,"px, ","px)","deg)"),Jk=Yp(Kk,", ",")",")"),tw=1e-12;function dd(e){return((e=Math.exp(e))+1/e)/2}function ew(e){return((e=Math.exp(e))-1/e)/2}function rw(e){return((e=Math.exp(2*e))-1)/(e+1)}const iw=(function e(t,r,i){function n(a,o){var s=a[0],c=a[1],l=a[2],h=o[0],u=o[1],f=o[2],d=h-s,p=u-c,g=d*d+p*p,b,y;if(g<tw)y=Math.log(f/l)/t,b=function(E){return[s+E*d,c+E*p,l*Math.exp(t*E*y)]};else{var x=Math.sqrt(g),C=(f*f-l*l+i*g)/(2*l*r*x),A=(f*f-l*l-i*g)/(2*f*r*x),B=Math.log(Math.sqrt(C*C+1)-C),w=Math.log(Math.sqrt(A*A+1)-A);y=(w-B)/t,b=function(E){var I=E*y,Y=dd(B),q=l/(r*x)*(Y*rw(t*I+B)-ew(B));return[s+q*d,c+q*p,l*Y/dd(t*I+B)]}}return b.duration=y*1e3*t/Math.SQRT2,b}return n.rho=function(a){var o=Math.max(.001,+a),s=o*o,c=s*s;return e(o,s,c)},n})(Math.SQRT2,2,4);var Kn=0,Ba=0,fa=0,Vp=1e3,go,$a,mo=0,pn=0,rl=0,ts=typeof performance=="object"&&performance.now?performance:Date,Xp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ah(){return pn||(Xp(nw),pn=ts.now()+rl)}function nw(){pn=0}function bo(){this._call=this._time=this._next=null}bo.prototype=Zp.prototype={constructor:bo,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Ah():+r)+(t==null?0:+t),!this._next&&$a!==this&&($a?$a._next=this:go=this,$a=this),this._call=e,this._time=r,xc()},stop:function(){this._call&&(this._call=null,this._time=1/0,xc())}};function Zp(e,t,r){var i=new bo;return i.restart(e,t,r),i}function aw(){Ah(),++Kn;for(var e=go,t;e;)(t=pn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Kn}function fd(){pn=(mo=ts.now())+rl,Kn=Ba=0;try{aw()}finally{Kn=0,ow(),pn=0}}function sw(){var e=ts.now(),t=e-mo;t>Vp&&(rl-=t,mo=e)}function ow(){for(var e,t=go,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:go=r);$a=e,xc(i)}function xc(e){if(!Kn){Ba&&(Ba=clearTimeout(Ba));var t=e-pn;t>24?(e<1/0&&(Ba=setTimeout(fd,e-ts.now()-rl)),fa&&(fa=clearInterval(fa))):(fa||(mo=ts.now(),fa=setInterval(sw,Vp)),Kn=1,Xp(fd))}}function pd(e,t,r){var i=new bo;return t=t==null?0:+t,i.restart(n=>{i.stop(),e(n+t)},t,r),i}var lw=wh("start","end","cancel","interrupt"),cw=[],Kp=0,gd=1,vc=2,Gs=3,md=4,_c=5,Ys=6;function il(e,t,r,i,n,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;hw(e,r,{name:t,index:i,group:n,on:lw,tween:cw,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Kp})}function Mh(e,t){var r=ri(e,t);if(r.state>Kp)throw new Error("too late; already scheduled");return r}function mi(e,t){var r=ri(e,t);if(r.state>Gs)throw new Error("too late; already running");return r}function ri(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function hw(e,t,r){var i=e.__transition,n;i[t]=r,r.timer=Zp(a,0,r.time);function a(l){r.state=gd,r.timer.restart(o,r.delay,r.time),r.delay<=l&&o(l-r.delay)}function o(l){var h,u,f,d;if(r.state!==gd)return c();for(h in i)if(d=i[h],d.name===r.name){if(d.state===Gs)return pd(o);d.state===md?(d.state=Ys,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[h]):+h<t&&(d.state=Ys,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete i[h])}if(pd(function(){r.state===Gs&&(r.state=md,r.timer.restart(s,r.delay,r.time),s(l))}),r.state=vc,r.on.call("start",e,e.__data__,r.index,r.group),r.state===vc){for(r.state=Gs,n=new Array(f=r.tween.length),h=0,u=-1;h<f;++h)(d=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(n[++u]=d);n.length=u+1}}function s(l){for(var h=l<r.duration?r.ease.call(null,l/r.duration):(r.timer.restart(c),r.state=_c,1),u=-1,f=n.length;++u<f;)n[u].call(e,h);r.state===_c&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Ys,r.timer.stop(),delete i[t];for(var l in i)return;delete e.__transition}}function Vs(e,t){var r=e.__transition,i,n,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((i=r[o]).name!==t){a=!1;continue}n=i.state>vc&&i.state<_c,i.state=Ys,i.timer.stop(),i.on.call(n?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[o]}a&&delete e.__transition}}function uw(e){return this.each(function(){Vs(this,e)})}function dw(e,t){var r,i;return function(){var n=mi(this,e),a=n.tween;if(a!==r){i=r=a;for(var o=0,s=i.length;o<s;++o)if(i[o].name===t){i=i.slice(),i.splice(o,1);break}}n.tween=i}}function fw(e,t,r){var i,n;if(typeof r!="function")throw new Error;return function(){var a=mi(this,e),o=a.tween;if(o!==i){n=(i=o).slice();for(var s={name:t,value:r},c=0,l=n.length;c<l;++c)if(n[c].name===t){n[c]=s;break}c===l&&n.push(s)}a.tween=n}}function pw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=ri(this.node(),r).tween,n=0,a=i.length,o;n<a;++n)if((o=i[n]).name===e)return o.value;return null}return this.each((t==null?dw:fw)(r,e,t))}function Lh(e,t,r){var i=e._id;return e.each(function(){var n=mi(this,i);(n.value||(n.value={}))[t]=r.apply(this,arguments)}),function(n){return ri(n,i).value[t]}}function Qp(e,t){var r;return(typeof t=="number"?Ni:t instanceof Ja?hd:(r=Ja(t))?(t=r,hd):Xk)(e,t)}function gw(e){return function(){this.removeAttribute(e)}}function mw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bw(e,t,r){var i,n=r+"",a;return function(){var o=this.getAttribute(e);return o===n?null:o===i?a:a=t(i=o,r)}}function yw(e,t,r){var i,n=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===n?null:o===i?a:a=t(i=o,r)}}function xw(e,t,r){var i,n,a;return function(){var o,s=r(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s)))}}function vw(e,t,r){var i,n,a;return function(){var o,s=r(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s)))}}function _w(e,t){var r=el(e),i=r==="transform"?Jk:Qp;return this.attrTween(e,typeof t=="function"?(r.local?vw:xw)(r,i,Lh(this,"attr."+e,t)):t==null?(r.local?mw:gw)(r):(r.local?yw:bw)(r,i,t))}function kw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function ww(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Cw(e,t){var r,i;function n(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ww(e,a)),r}return n._value=t,n}function Sw(e,t){var r,i;function n(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&kw(e,a)),r}return n._value=t,n}function Tw(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=el(e);return this.tween(r,(i.local?Cw:Sw)(i,t))}function Ew(e,t){return function(){Mh(this,e).delay=+t.apply(this,arguments)}}function Aw(e,t){return t=+t,function(){Mh(this,e).delay=t}}function Mw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ew:Aw)(t,e)):ri(this.node(),t).delay}function Lw(e,t){return function(){mi(this,e).duration=+t.apply(this,arguments)}}function Bw(e,t){return t=+t,function(){mi(this,e).duration=t}}function $w(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Lw:Bw)(t,e)):ri(this.node(),t).duration}function Rw(e,t){if(typeof t!="function")throw new Error;return function(){mi(this,e).ease=t}}function Ow(e){var t=this._id;return arguments.length?this.each(Rw(t,e)):ri(this.node(),t).ease}function Nw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;mi(this,e).ease=r}}function Iw(e){if(typeof e!="function")throw new Error;return this.each(Nw(this._id,e))}function Dw(e){typeof e!="function"&&(e=$p(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Mi(i,this._parents,this._name,this._id)}function Fw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,n=r.length,a=Math.min(i,n),o=new Array(i),s=0;s<a;++s)for(var c=t[s],l=r[s],h=c.length,u=o[s]=new Array(h),f,d=0;d<h;++d)(f=c[d]||l[d])&&(u[d]=f);for(;s<i;++s)o[s]=t[s];return new Mi(o,this._parents,this._name,this._id)}function Pw(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function zw(e,t,r){var i,n,a=Pw(t)?Mh:mi;return function(){var o=a(this,e),s=o.on;s!==i&&(n=(i=s).copy()).on(t,r),o.on=n}}function Ww(e,t){var r=this._id;return arguments.length<2?ri(this.node(),r).on.on(e):this.each(zw(r,e,t))}function qw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Hw(){return this.on("end.remove",qw(this._id))}function jw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Ch(e));for(var i=this._groups,n=i.length,a=new Array(n),o=0;o<n;++o)for(var s=i[o],c=s.length,l=a[o]=new Array(c),h,u,f=0;f<c;++f)(h=s[f])&&(u=e.call(h,h.__data__,f,s))&&("__data__"in h&&(u.__data__=h.__data__),l[f]=u,il(l[f],t,r,f,l,ri(h,r)));return new Mi(a,this._parents,t,r)}function Uw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Bp(e));for(var i=this._groups,n=i.length,a=[],o=[],s=0;s<n;++s)for(var c=i[s],l=c.length,h,u=0;u<l;++u)if(h=c[u]){for(var f=e.call(h,h.__data__,u,c),d,p=ri(h,r),g=0,b=f.length;g<b;++g)(d=f[g])&&il(d,t,r,g,f,p);a.push(f),o.push(h)}return new Mi(a,o,t,r)}var Gw=us.prototype.constructor;function Yw(){return new Gw(this._groups,this._parents)}function Vw(e,t){var r,i,n;return function(){var a=Zn(this,e),o=(this.style.removeProperty(e),Zn(this,e));return a===o?null:a===r&&o===i?n:n=t(r=a,i=o)}}function Jp(e){return function(){this.style.removeProperty(e)}}function Xw(e,t,r){var i,n=r+"",a;return function(){var o=Zn(this,e);return o===n?null:o===i?a:a=t(i=o,r)}}function Zw(e,t,r){var i,n,a;return function(){var o=Zn(this,e),s=r(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Zn(this,e))),o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s))}}function Kw(e,t){var r,i,n,a="style."+t,o="end."+a,s;return function(){var c=mi(this,e),l=c.on,h=c.value[a]==null?s||(s=Jp(t)):void 0;(l!==r||n!==h)&&(i=(r=l).copy()).on(o,n=h),c.on=i}}function Qw(e,t,r){var i=(e+="")=="transform"?Qk:Qp;return t==null?this.styleTween(e,Vw(e,i)).on("end.style."+e,Jp(e)):typeof t=="function"?this.styleTween(e,Zw(e,i,Lh(this,"style."+e,t))).each(Kw(this._id,e)):this.styleTween(e,Xw(e,i,t),r).on("end.style."+e,null)}function Jw(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function t2(e,t,r){var i,n;function a(){var o=t.apply(this,arguments);return o!==n&&(i=(n=o)&&Jw(e,o,r)),i}return a._value=t,a}function e2(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,t2(e,t,r??""))}function r2(e){return function(){this.textContent=e}}function i2(e){return function(){var t=e(this);this.textContent=t??""}}function n2(e){return this.tween("text",typeof e=="function"?i2(Lh(this,"text",e)):r2(e==null?"":e+""))}function a2(e){return function(t){this.textContent=e.call(this,t)}}function s2(e){var t,r;function i(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&a2(n)),t}return i._value=e,i}function o2(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,s2(e))}function l2(){for(var e=this._name,t=this._id,r=tg(),i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var h=ri(c,t);il(c,e,r,l,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Mi(i,this._parents,e,r)}function c2(){var e,t,r=this,i=r._id,n=r.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--n===0&&a()}};r.each(function(){var l=mi(this,i),h=l.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),l.on=t}),n===0&&a()})}var h2=0;function Mi(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function tg(){return++h2}var xi=us.prototype;Mi.prototype={constructor:Mi,select:jw,selectAll:Uw,selectChild:xi.selectChild,selectChildren:xi.selectChildren,filter:Dw,merge:Fw,selection:Yw,transition:l2,call:xi.call,nodes:xi.nodes,node:xi.node,size:xi.size,empty:xi.empty,each:xi.each,on:Ww,attr:_w,attrTween:Tw,style:Qw,styleTween:e2,text:n2,textTween:o2,remove:Hw,tween:pw,delay:Mw,duration:$w,ease:Ow,easeVarying:Iw,end:c2,[Symbol.iterator]:xi[Symbol.iterator]};function u2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var d2={time:null,delay:0,duration:250,ease:u2};function f2(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function p2(e){var t,r;e instanceof Mi?(t=e._id,e=e._name):(t=tg(),(r=d2).time=Ah(),e=e==null?null:e+"");for(var i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&il(c,e,t,l,o,r||f2(c,t));return new Mi(i,this._parents,e,t)}us.prototype.interrupt=uw;us.prototype.transition=p2;const kc=Math.PI,wc=2*kc,en=1e-6,g2=wc-en;function eg(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function m2(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return eg;const r=10**t;return function(i){this._+=i[0];for(let n=1,a=i.length;n<a;++n)this._+=Math.round(arguments[n]*r)/r+i[n]}}class b2{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?eg:m2(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,n){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(t,r,i,n,a,o){this._append`C${+t},${+r},${+i},${+n},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,i,n,a){if(t=+t,r=+r,i=+i,n=+n,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,c=i-t,l=n-r,h=o-t,u=s-r,f=h*h+u*u;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>en)if(!(Math.abs(u*c-l*h)>en)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=i-o,p=n-s,g=c*c+l*l,b=d*d+p*p,y=Math.sqrt(g),x=Math.sqrt(f),C=a*Math.tan((kc-Math.acos((g+f-b)/(2*y*x)))/2),A=C/x,B=C/y;Math.abs(A-1)>en&&this._append`L${t+A*h},${r+A*u}`,this._append`A${a},${a},0,0,${+(u*d>h*p)},${this._x1=t+B*c},${this._y1=r+B*l}`}}arc(t,r,i,n,a,o){if(t=+t,r=+r,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(n),c=i*Math.sin(n),l=t+s,h=r+c,u=1^o,f=o?n-a:a-n;this._x1===null?this._append`M${l},${h}`:(Math.abs(this._x1-l)>en||Math.abs(this._y1-h)>en)&&this._append`L${l},${h}`,i&&(f<0&&(f=f%wc+wc),f>g2?this._append`A${i},${i},0,1,${u},${t-s},${r-c}A${i},${i},0,1,${u},${this._x1=l},${this._y1=h}`:f>en&&this._append`A${i},${i},0,${+(f>=kc)},${u},${this._x1=t+i*Math.cos(a)},${this._y1=r+i*Math.sin(a)}`)}rect(t,r,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function y2(e){var t=0,r=e.children,i=r&&r.length;if(!i)t=1;else for(;--i>=0;)t+=r[i].value;e.value=t}function x2(){return this.eachAfter(y2)}function v2(e,t){let r=-1;for(const i of this)e.call(t,i,++r,this);return this}function _2(e,t){for(var r=this,i=[r],n,a,o=-1;r=i.pop();)if(e.call(t,r,++o,this),n=r.children)for(a=n.length-1;a>=0;--a)i.push(n[a]);return this}function k2(e,t){for(var r=this,i=[r],n=[],a,o,s,c=-1;r=i.pop();)if(n.push(r),a=r.children)for(o=0,s=a.length;o<s;++o)i.push(a[o]);for(;r=n.pop();)e.call(t,r,++c,this);return this}function w2(e,t){let r=-1;for(const i of this)if(e.call(t,i,++r,this))return i}function C2(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,i=t.children,n=i&&i.length;--n>=0;)r+=i[n].value;t.value=r})}function S2(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function T2(e){for(var t=this,r=E2(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var n=i.length;e!==r;)i.splice(n,0,e),e=e.parent;return i}function E2(e,t){if(e===t)return e;var r=e.ancestors(),i=t.ancestors(),n=null;for(e=r.pop(),t=i.pop();e===t;)n=e,e=r.pop(),t=i.pop();return n}function A2(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function M2(){return Array.from(this)}function L2(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function B2(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t}function*$2(){var e=this,t,r=[e],i,n,a;do for(t=r.reverse(),r=[];e=t.pop();)if(yield e,i=e.children)for(n=0,a=i.length;n<a;++n)r.push(i[n]);while(r.length)}function Bh(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=N2)):t===void 0&&(t=O2);for(var r=new es(e),i,n=[r],a,o,s,c;i=n.pop();)if((o=t(i.data))&&(c=(o=Array.from(o)).length))for(i.children=o,s=c-1;s>=0;--s)n.push(a=o[s]=new es(o[s])),a.parent=i,a.depth=i.depth+1;return r.eachBefore(D2)}function R2(){return Bh(this).eachBefore(I2)}function O2(e){return e.children}function N2(e){return Array.isArray(e)?e[1]:null}function I2(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function D2(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function es(e){this.data=e,this.depth=this.height=0,this.parent=null}es.prototype=Bh.prototype={constructor:es,count:x2,each:v2,eachAfter:k2,eachBefore:_2,find:w2,sum:C2,sort:S2,path:T2,ancestors:A2,descendants:M2,leaves:L2,links:B2,copy:R2,[Symbol.iterator]:$2};function F2(e,t){return e.parent===t.parent?1:2}function Wl(e){var t=e.children;return t?t[0]:e.t}function ql(e){var t=e.children;return t?t[t.length-1]:e.t}function P2(e,t,r){var i=r/(t.i-e.i);t.c-=i,t.s+=r,e.c+=i,t.z+=r,t.m+=r}function z2(e){for(var t=0,r=0,i=e.children,n=i.length,a;--n>=0;)a=i[n],a.z+=t,a.m+=t,t+=a.s+(r+=a.c)}function W2(e,t,r){return e.a.parent===t.parent?e.a:r}function Xs(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Xs.prototype=Object.create(es.prototype);function q2(e){for(var t=new Xs(e,0),r,i=[t],n,a,o,s;r=i.pop();)if(a=r._.children)for(r.children=new Array(s=a.length),o=s-1;o>=0;--o)i.push(n=r.children[o]=new Xs(a[o],o)),n.parent=r;return(t.parent=new Xs(null,0)).children=[t],t}function H2(){var e=F2,t=1,r=1,i=null;function n(l){var h=q2(l);if(h.eachAfter(a),h.parent.m=-h.z,h.eachBefore(o),i)l.eachBefore(c);else{var u=l,f=l,d=l;l.eachBefore(function(x){x.x<u.x&&(u=x),x.x>f.x&&(f=x),x.depth>d.depth&&(d=x)});var p=u===f?1:e(u,f)/2,g=p-u.x,b=t/(f.x+p+g),y=r/(d.depth||1);l.eachBefore(function(x){x.x=(x.x+g)*b,x.y=x.depth*y})}return l}function a(l){var h=l.children,u=l.parent.children,f=l.i?u[l.i-1]:null;if(h){z2(l);var d=(h[0].z+h[h.length-1].z)/2;f?(l.z=f.z+e(l._,f._),l.m=l.z-d):l.z=d}else f&&(l.z=f.z+e(l._,f._));l.parent.A=s(l,f,l.parent.A||u[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function s(l,h,u){if(h){for(var f=l,d=l,p=h,g=f.parent.children[0],b=f.m,y=d.m,x=p.m,C=g.m,A;p=ql(p),f=Wl(f),p&&f;)g=Wl(g),d=ql(d),d.a=l,A=p.z+x-f.z-b+e(p._,f._),A>0&&(P2(W2(p,l,u),l,A),b+=A,y+=A),x+=p.m,b+=f.m,C+=g.m,y+=d.m;p&&!ql(d)&&(d.t=p,d.m+=x-y),f&&!Wl(g)&&(g.t=f,g.m+=b-C,u=l)}return u}function c(l){l.x*=t,l.y=l.depth*r}return n.separation=function(l){return arguments.length?(e=l,n):e},n.size=function(l){return arguments.length?(i=!1,t=+l[0],r=+l[1],n):i?null:[t,r]},n.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],r=+l[1],n):i?[t,r]:null},n}function Ii(e){return function(){return e}}const uD=Math.abs,dD=Math.atan2,fD=Math.cos,pD=Math.max,gD=Math.min,mD=Math.sin,bD=Math.sqrt,bd=1e-12,$h=Math.PI,yd=$h/2,yD=2*$h;function xD(e){return e>1?0:e<-1?$h:Math.acos(e)}function vD(e){return e>=1?yd:e<=-1?-yd:Math.asin(e)}function rg(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new b2(t)}var j2=Array.prototype.slice;function U2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ig(e){this._context=e}ig.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function yo(e){return new ig(e)}function ng(e){return e[0]}function ag(e){return e[1]}function G2(e,t){var r=Ii(!0),i=null,n=yo,a=null,o=rg(s);e=typeof e=="function"?e:e===void 0?ng:Ii(e),t=typeof t=="function"?t:t===void 0?ag:Ii(t);function s(c){var l,h=(c=U2(c)).length,u,f=!1,d;for(i==null&&(a=n(d=o())),l=0;l<=h;++l)!(l<h&&r(u=c[l],l,c))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(u,l,c),+t(u,l,c));if(d)return a=null,d+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ii(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ii(+c),s):t},s.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Ii(!!c),s):r},s.curve=function(c){return arguments.length?(n=c,i!=null&&(a=n(i)),s):n},s.context=function(c){return arguments.length?(c==null?i=a=null:a=n(i=c),s):i},s}function Es(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class sg{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}class Y2{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{const i=Es(this._x0,this._y0),n=Es(this._x0,this._y0=(this._y0+r)/2),a=Es(t,this._y0),o=Es(t,r);this._context.moveTo(...i),this._context.bezierCurveTo(...n,...a,...o)}this._x0=t,this._y0=r}}function og(e){return new sg(e,!0)}function lg(e){return new sg(e,!1)}function V2(e){return new Y2(e)}function X2(e){return e.source}function Z2(e){return e.target}function K2(e){let t=X2,r=Z2,i=ng,n=ag,a=null,o=null,s=rg(c);function c(){let l;const h=j2.call(arguments),u=t.apply(this,h),f=r.apply(this,h);if(a==null&&(o=e(l=s())),o.lineStart(),h[0]=u,o.point(+i.apply(this,h),+n.apply(this,h)),h[0]=f,o.point(+i.apply(this,h),+n.apply(this,h)),o.lineEnd(),l)return o=null,l+""||null}return c.source=function(l){return arguments.length?(t=l,c):t},c.target=function(l){return arguments.length?(r=l,c):r},c.x=function(l){return arguments.length?(i=typeof l=="function"?l:Ii(+l),c):i},c.y=function(l){return arguments.length?(n=typeof l=="function"?l:Ii(+l),c):n},c.context=function(l){return arguments.length?(l==null?a=o=null:o=e(a=l),c):a},c}function Q2(){const e=K2(V2);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}function zi(){}function xo(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function nl(e){this._context=e}nl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Zs(e){return new nl(e)}function cg(e){this._context=e}cg.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:xo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J2(e){return new cg(e)}function hg(e){this._context=e}hg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:xo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tC(e){return new hg(e)}function ug(e,t){this._basis=new nl(e),this._beta=t}ug.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],n=t[0],a=e[r]-i,o=t[r]-n,s=-1,c;++s<=r;)c=s/r,this._basis.point(this._beta*e[s]+(1-this._beta)*(i+c*a),this._beta*t[s]+(1-this._beta)*(n+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const eC=(function e(t){function r(i){return t===1?new nl(i):new ug(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function vo(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Rh(e,t){this._context=e,this._k=(1-t)/6}Rh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const dg=(function e(t){function r(i){return new Rh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Oh(e,t){this._context=e,this._k=(1-t)/6}Oh.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rC=(function e(t){function r(i){return new Oh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Nh(e,t){this._context=e,this._k=(1-t)/6}Nh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iC=(function e(t){function r(i){return new Nh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ih(e,t,r){var i=e._x1,n=e._y1,a=e._x2,o=e._y2;if(e._l01_a>bd){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,n=(n*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>bd){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/h,o=(o*l+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,n,a,o,e._x2,e._y2)}function fg(e,t){this._context=e,this._alpha=t}fg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ih(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const pg=(function e(t){function r(i){return t?new fg(i,t):new Rh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function gg(e,t){this._context=e,this._alpha=t}gg.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ih(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nC=(function e(t){function r(i){return t?new gg(i,t):new Oh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function mg(e,t){this._context=e,this._alpha=t}mg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ih(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const aC=(function e(t){function r(i){return t?new mg(i,t):new Nh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function bg(e){this._context=e}bg.prototype={areaStart:zi,areaEnd:zi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function sC(e){return new bg(e)}function xd(e){return e<0?-1:1}function vd(e,t,r){var i=e._x1-e._x0,n=t-e._x1,a=(e._y1-e._y0)/(i||n<0&&-0),o=(r-e._y1)/(n||i<0&&-0),s=(a*n+o*i)/(i+n);return(xd(a)+xd(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function _d(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Hl(e,t,r){var i=e._x0,n=e._y0,a=e._x1,o=e._y1,s=(a-i)/3;e._context.bezierCurveTo(i+s,n+s*t,a-s,o-s*r,a,o)}function _o(e){this._context=e}_o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Hl(this,this._t0,_d(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Hl(this,_d(this,r=vd(this,e,t)),r);break;default:Hl(this,this._t0,r=vd(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function yg(e){this._context=new xg(e)}(yg.prototype=Object.create(_o.prototype)).point=function(e,t){_o.prototype.point.call(this,t,e)};function xg(e){this._context=e}xg.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,n,a){this._context.bezierCurveTo(t,e,i,r,a,n)}};function vg(e){return new _o(e)}function _g(e){return new yg(e)}function kg(e){this._context=e}kg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=kd(e),n=kd(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(i[0][a],n[0][a],i[1][a],n[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function kd(e){var t,r=e.length-1,i,n=new Array(r),a=new Array(r),o=new Array(r);for(n[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)n[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(n[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=n[t]/a[t-1],a[t]-=i,o[t]-=i*o[t-1];for(n[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)n[t]=(o[t]-n[t+1])/a[t];for(a[r-1]=(e[r]+n[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-n[t+1];return[n,a]}function wg(e){return new kg(e)}function al(e,t){this._context=e,this._t=t}al.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Cg(e){return new al(e,.5)}function Sg(e){return new al(e,0)}function Tg(e){return new al(e,1)}const As=e=>()=>e;function oC(e,{sourceEvent:t,target:r,transform:i,dispatch:n}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:n}})}function Ti(e,t,r){this.k=e,this.x=t,this.y=r}Ti.prototype={constructor:Ti,scale:function(e){return e===1?this:new Ti(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ti(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Dh=new Ti(1,0,0);Ti.prototype;function jl(e){e.stopImmediatePropagation()}function pa(e){e.preventDefault(),e.stopImmediatePropagation()}function lC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function cC(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function wd(){return this.__zoom||Dh}function hC(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uC(){return navigator.maxTouchPoints||"ontouchstart"in this}function dC(e,t,r){var i=e.invertX(t[0][0])-r[0][0],n=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],o=e.invertY(t[1][1])-r[1][1];return e.translate(n>i?(i+n)/2:Math.min(0,i)||Math.max(0,n),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function fC(){var e=lC,t=cC,r=dC,i=hC,n=uC,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=iw,l=wh("start","zoom","end"),h,u,f,d=500,p=150,g=0,b=10;function y(_){_.property("__zoom",wd).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",Y).on("dblclick.zoom",q).filter(n).on("touchstart.zoom",F).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(_,T,k,S){var M=_.selection?_.selection():_;M.property("__zoom",wd),_!==M?B(_,T,k,S):M.interrupt().each(function(){w(this,arguments).event(S).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},y.scaleBy=function(_,T,k,S){y.scaleTo(_,function(){var M=this.__zoom.k,W=typeof T=="function"?T.apply(this,arguments):T;return M*W},k,S)},y.scaleTo=function(_,T,k,S){y.transform(_,function(){var M=t.apply(this,arguments),W=this.__zoom,N=k==null?A(M):typeof k=="function"?k.apply(this,arguments):k,O=W.invert(N),j=typeof T=="function"?T.apply(this,arguments):T;return r(C(x(W,j),N,O),M,o)},k,S)},y.translateBy=function(_,T,k,S){y.transform(_,function(){return r(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),o)},null,S)},y.translateTo=function(_,T,k,S,M){y.transform(_,function(){var W=t.apply(this,arguments),N=this.__zoom,O=S==null?A(W):typeof S=="function"?S.apply(this,arguments):S;return r(Dh.translate(O[0],O[1]).scale(N.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof k=="function"?-k.apply(this,arguments):-k),W,o)},S,M)};function x(_,T){return T=Math.max(a[0],Math.min(a[1],T)),T===_.k?_:new Ti(T,_.x,_.y)}function C(_,T,k){var S=T[0]-k[0]*_.k,M=T[1]-k[1]*_.k;return S===_.x&&M===_.y?_:new Ti(_.k,S,M)}function A(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function B(_,T,k,S){_.on("start.zoom",function(){w(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(S).end()}).tween("zoom",function(){var M=this,W=arguments,N=w(M,W).event(S),O=t.apply(M,W),j=k==null?A(O):typeof k=="function"?k.apply(M,W):k,G=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),X=M.__zoom,J=typeof T=="function"?T.apply(M,W):T,K=c(X.invert(j).concat(G/X.k),J.invert(j).concat(G/J.k));return function(at){if(at===1)at=J;else{var lt=K(at),wt=G/lt[2];at=new Ti(wt,j[0]-lt[0]*wt,j[1]-lt[1]*wt)}N.zoom(null,at)}})}function w(_,T,k){return!k&&_.__zooming||new E(_,T)}function E(_,T){this.that=_,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,T),this.taps=0}E.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,T){return this.mouse&&_!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var T=se(this.that).datum();l.call(_,this.that,new oC(_,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:l}),T)}};function I(_,...T){if(!e.apply(this,arguments))return;var k=w(this,T).event(_),S=this.__zoom,M=Math.max(a[0],Math.min(a[1],S.k*Math.pow(2,i.apply(this,arguments)))),W=Ki(_);if(k.wheel)(k.mouse[0][0]!==W[0]||k.mouse[0][1]!==W[1])&&(k.mouse[1]=S.invert(k.mouse[0]=W)),clearTimeout(k.wheel);else{if(S.k===M)return;k.mouse=[W,S.invert(W)],Vs(this),k.start()}pa(_),k.wheel=setTimeout(N,p),k.zoom("mouse",r(C(x(S,M),k.mouse[0],k.mouse[1]),k.extent,o));function N(){k.wheel=null,k.end()}}function Y(_,...T){if(f||!e.apply(this,arguments))return;var k=_.currentTarget,S=w(this,T,!0).event(_),M=se(_.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",G,!0),W=Ki(_,k),N=_.clientX,O=_.clientY;Bk(_.view),jl(_),S.mouse=[W,this.__zoom.invert(W)],Vs(this),S.start();function j(X){if(pa(X),!S.moved){var J=X.clientX-N,K=X.clientY-O;S.moved=J*J+K*K>g}S.event(X).zoom("mouse",r(C(S.that.__zoom,S.mouse[0]=Ki(X,k),S.mouse[1]),S.extent,o))}function G(X){M.on("mousemove.zoom mouseup.zoom",null),$k(X.view,S.moved),pa(X),S.event(X).end()}}function q(_,...T){if(e.apply(this,arguments)){var k=this.__zoom,S=Ki(_.changedTouches?_.changedTouches[0]:_,this),M=k.invert(S),W=k.k*(_.shiftKey?.5:2),N=r(C(x(k,W),S,M),t.apply(this,T),o);pa(_),s>0?se(this).transition().duration(s).call(B,N,S,_):se(this).call(y.transform,N,S,_)}}function F(_,...T){if(e.apply(this,arguments)){var k=_.touches,S=k.length,M=w(this,T,_.changedTouches.length===S).event(_),W,N,O,j;for(jl(_),N=0;N<S;++N)O=k[N],j=Ki(O,this),j=[j,this.__zoom.invert(j),O.identifier],M.touch0?!M.touch1&&M.touch0[2]!==j[2]&&(M.touch1=j,M.taps=0):(M.touch0=j,W=!0,M.taps=1+!!h);h&&(h=clearTimeout(h)),W&&(M.taps<2&&(u=j[0],h=setTimeout(function(){h=null},d)),Vs(this),M.start())}}function z(_,...T){if(this.__zooming){var k=w(this,T).event(_),S=_.changedTouches,M=S.length,W,N,O,j;for(pa(_),W=0;W<M;++W)N=S[W],O=Ki(N,this),k.touch0&&k.touch0[2]===N.identifier?k.touch0[0]=O:k.touch1&&k.touch1[2]===N.identifier&&(k.touch1[0]=O);if(N=k.that.__zoom,k.touch1){var G=k.touch0[0],X=k.touch0[1],J=k.touch1[0],K=k.touch1[1],at=(at=J[0]-G[0])*at+(at=J[1]-G[1])*at,lt=(lt=K[0]-X[0])*lt+(lt=K[1]-X[1])*lt;N=x(N,Math.sqrt(at/lt)),O=[(G[0]+J[0])/2,(G[1]+J[1])/2],j=[(X[0]+K[0])/2,(X[1]+K[1])/2]}else if(k.touch0)O=k.touch0[0],j=k.touch0[1];else return;k.zoom("touch",r(C(N,O,j),k.extent,o))}}function D(_,...T){if(this.__zooming){var k=w(this,T).event(_),S=_.changedTouches,M=S.length,W,N;for(jl(_),f&&clearTimeout(f),f=setTimeout(function(){f=null},d),W=0;W<M;++W)N=S[W],k.touch0&&k.touch0[2]===N.identifier?delete k.touch0:k.touch1&&k.touch1[2]===N.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(N=Ki(N,this),Math.hypot(u[0]-N[0],u[1]-N[1])<b)){var O=se(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return y.wheelDelta=function(_){return arguments.length?(i=typeof _=="function"?_:As(+_),y):i},y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:As(!!_),y):e},y.touchable=function(_){return arguments.length?(n=typeof _=="function"?_:As(!!_),y):n},y.extent=function(_){return arguments.length?(t=typeof _=="function"?_:As([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),y):t},y.scaleExtent=function(_){return arguments.length?(a[0]=+_[0],a[1]=+_[1],y):[a[0],a[1]]},y.translateExtent=function(_){return arguments.length?(o[0][0]=+_[0][0],o[1][0]=+_[1][0],o[0][1]=+_[0][1],o[1][1]=+_[1][1],y):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},y.constrain=function(_){return arguments.length?(r=_,y):r},y.duration=function(_){return arguments.length?(s=+_,y):s},y.interpolate=function(_){return arguments.length?(c=_,y):c},y.on=function(){var _=l.on.apply(l,arguments);return _===l?y:_},y.clickDistance=function(_){return arguments.length?(g=(_=+_)*_,y):Math.sqrt(g)},y.tapDistance=function(_){return arguments.length?(b=+_,y):b},y}function pC(e){if(e.length===0)return"";if(e.length===1){const i=e[0].split("/").filter(Boolean);return i.pop(),"/"+i.join("/")}const t=e.map(i=>i.split("/").filter(Boolean)),r=[];for(let i=0;i<t[0].length;i++){const n=t[0][i];if(t.every(a=>a[i]===n))r.push(n);else break}return"/"+r.join("/")}function gC(e){const t=pC(e.map(a=>a.path)),i={name:t.split("/").pop()||"project",path:t,children:[],isFile:!1},n=[...e].sort((a,o)=>a.path.localeCompare(o.path));for(const a of n){const s=(a.path.startsWith(t)?a.path.slice(t.length):a.path).split("/").filter(Boolean);let c=i;for(let l=0;l<s.length;l++){const h=s[l],u=l===s.length-1,f="/"+s.slice(0,l+1).join("/");c.children||(c.children=[]);let d=c.children.find(p=>p.name===h);d?u&&(d.operation=a.operation,d.timestamp=a.timestamp,d.file=a):(d={name:h,path:f,isFile:u,children:u?void 0:[]},u&&(d.operation=a.operation,d.timestamp=a.timestamp,d.file=a),c.children.push(d)),c=d}}return i}function mC(e){return Bh(e,t=>t.children)}function Ms(e){switch(e){case"read":return"#3b82f6";case"write":return"#22c55e";case"edit":return"#f59e0b";default:return"#6b7280"}}function Ls(e){switch(e){case"read":return"#93c5fd";case"write":return"#86efac";case"edit":return"#fcd34d";default:return"#9ca3af"}}var bC=it('<div class="absolute inset-0 flex items-center justify-center text-slate-400 svelte-1uw5zj"><div class="text-center svelte-1uw5zj"><svg class="w-16 h-16 mx-auto mb-3 opacity-50 svelte-1uw5zj" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" class="svelte-1uw5zj"></path></svg> <p class="text-lg mb-2 font-medium svelte-1uw5zj">No files to visualize</p> <p class="text-sm text-slate-500 svelte-1uw5zj">Files that Claude touches will appear in the tree</p></div></div>'),yC=it('<div class="flex items-center gap-1 svelte-1uw5zj"><span class="text-red-400 svelte-1uw5zj"> </span> <span class="text-slate-500 svelte-1uw5zj">deletions</span></div>'),xC=it('<div class="flex items-center gap-4 text-sm svelte-1uw5zj"><div class="flex items-center gap-1 svelte-1uw5zj"><span class="text-green-400 svelte-1uw5zj"> </span> <span class="text-slate-500 svelte-1uw5zj">additions</span></div> <!></div>'),vC=it('<div class="text-slate-400 text-xs italic svelte-1uw5zj"> </div>'),_C=it('<div class="fixed z-50 px-4 py-3 bg-slate-800/95 text-slate-100 text-xs rounded-lg shadow-xl border border-slate-600 pointer-events-none backdrop-blur-sm svelte-1uw5zj"><div class="font-mono text-[10px] text-slate-400 mb-2 truncate max-w-xs svelte-1uw5zj"> </div> <div class="flex items-center gap-3 mb-2 svelte-1uw5zj"><span> </span></div> <!></div>'),kC=it('<svg class="w-full h-full svelte-1uw5zj"></svg> <div class="absolute top-4 right-4 flex flex-col gap-2 svelte-1uw5zj"><button class="px-3 py-2 bg-slate-800/90 hover:bg-slate-700 text-slate-300 rounded-lg border border-slate-600 text-xs font-medium transition-colors svelte-1uw5zj" title="Reset Zoom">Reset Zoom</button></div> <div class="absolute bottom-4 left-4 bg-slate-800/90 rounded-lg p-3 text-xs text-slate-300 border border-slate-700 svelte-1uw5zj"><div class="font-semibold mb-2 svelte-1uw5zj">Operations</div> <div class="flex flex-col gap-1.5 svelte-1uw5zj"><div class="flex items-center gap-2 svelte-1uw5zj"><div class="w-3 h-3 rounded-full bg-violet-500 border-2 border-violet-400 svelte-1uw5zj"></div> <span class="svelte-1uw5zj">Root</span></div> <div class="flex items-center gap-2 svelte-1uw5zj"><div class="w-3 h-3 rounded-full svelte-1uw5zj"></div> <span class="svelte-1uw5zj">Read</span></div> <div class="flex items-center gap-2 svelte-1uw5zj"><div class="w-3 h-3 rounded-full svelte-1uw5zj"></div> <span class="svelte-1uw5zj">Write</span></div> <div class="flex items-center gap-2 svelte-1uw5zj"><div class="w-3 h-3 rounded-full svelte-1uw5zj"></div> <span class="svelte-1uw5zj">Edit</span></div> <div class="flex items-center gap-2 svelte-1uw5zj"><div class="w-3 h-3 rounded-full bg-amber-500 border-2 border-amber-400 radar-pulse svelte-1uw5zj"></div> <span class="svelte-1uw5zj">Recent (3s)</span></div> <div class="flex items-center gap-2 svelte-1uw5zj"><div class="w-2 h-2 rounded-full bg-slate-600 border-2 border-slate-500 svelte-1uw5zj"></div> <span class="svelte-1uw5zj">Directory</span></div></div></div> <!>',1),wC=it('<div class="relative w-full h-full bg-slate-900 min-h-[400px] svelte-1uw5zj"><!></div>');function CC(e,t){Ir(t,!0);let r=We(t,"files",19,()=>[]),i=We(t,"selectedFile",3,null),n,a,o=ae(800),s=ae(600),c=ae(null),l=null,h=ae(Bi(new Set)),u=new Map,f=new Set;ir(()=>{n&&r().length>0&&(new Set(r().map(F=>F.path)),r().filter(F=>!f.has(F.eventId)).forEach(F=>{f.add(F.eventId),v(h).add(F.path);const z=u.get(F.path);z&&clearTimeout(z);const D=setTimeout(()=>{v(h).delete(F.path),et(h,v(h),!0),u.delete(F.path)},3e3);u.set(F.path,D)}),p())}),tl(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d),u.forEach(q=>clearTimeout(q)),u.clear()}));function d(){if(a){const q=a.getBoundingClientRect();et(o,q.width,!0),et(s,q.height,!0),r().length>0&&p()}}function p(){if(!n||r().length===0)return;const q=gC(r()),F=mC(q),z=Math.min(v(o),v(s))/2-120,_=H2().size([2*Math.PI,z]).separation((O,j)=>(O.parent===j.parent?1:2)/O.depth)(F),T=se(n);T.selectAll("*").remove(),l||(l=fC().scaleExtent([.5,3]).on("zoom",O=>{et(c,O.transform,!0),k.attr("transform",`translate(${v(o)/2},${v(s)/2}) ${O.transform}`)}),T.call(l));const k=T.append("g").attr("transform",`translate(${v(o)/2},${v(s)/2})`),S=Q2().angle(O=>O.x).radius(O=>O.y);k.append("g").attr("class","links").attr("fill","none").attr("stroke","#64748b").attr("stroke-opacity",.8).attr("stroke-width",2).selectAll("path").data(_.links()).join("path").attr("d",S);const M=[];_.descendants().forEach(O=>{const j=O.x-Math.PI/2,G=O.y*Math.cos(j),X=O.y*Math.sin(j),J=O.x<Math.PI,K=O.depth===0?"📁 root":O.data.name,at=O.depth===0?12:O.data.isFile?10:9,lt=at*.6,wt=K.length*lt,_t=at*1.5,ot=J?10:-10-wt;M.push({node:O,x:G+ot,y:X-_t/2,width:wt,height:_t,isRightSide:J})});for(let O=0;O<M.length;O++)for(let j=O+1;j<M.length;j++){const G=M[O],X=M[j];if(G.isRightSide===X.isRightSide){const J=Math.abs(G.x-X.x)<Math.max(G.width,X.width),K=Math.abs(G.y-X.y)<(G.height+X.height)/2;J&&K&&(X.y+=G.height*.7)}}k.append("g").attr("class","nodes").selectAll("g").data(_.descendants()).join("g").attr("transform",O=>{const j=O.x-Math.PI/2,G=O.y*Math.cos(j),X=O.y*Math.sin(j);return`translate(${G},${X})`}).append("circle").attr("r",O=>O.depth===0?8:O.data.isFile?5:4).attr("fill",O=>{var X;if(O.depth===0)return"#8b5cf6";const j=i()&&((X=O.data.file)==null?void 0:X.path)===i().path,G=O.data.file&&v(h).has(O.data.file.path);return j?"#06b6d4":G?"#f59e0b":O.data.isFile?Ls(O.data.operation):"#475569"}).attr("stroke",O=>{var X;if(O.depth===0)return"#a78bfa";const j=i()&&((X=O.data.file)==null?void 0:X.path)===i().path,G=O.data.file&&v(h).has(O.data.file.path);return j?"#06b6d4":G?"#f59e0b":Ms(O.data.operation)}).attr("stroke-width",O=>{var X;const j=i()&&((X=O.data.file)==null?void 0:X.path)===i().path,G=O.data.file&&v(h).has(O.data.file.path);return j||G?3:2}).attr("cursor",O=>O.data.isFile?"pointer":"default").attr("class",O=>O.data.file&&v(h).has(O.data.file.path)?"radar-pulse":"").on("click",(O,j)=>{j.data.isFile&&j.data.file&&t.onFileSelect&&t.onFileSelect(j.data.file)}).on("mouseenter",function(O,j){j.data.isFile&&j.data.file&&(se(this).attr("r",7).attr("stroke-width",3),C(O,j.data.file))}).on("mouseleave",function(O,j){var G;if(j.data.isFile){const X=i()&&((G=j.data.file)==null?void 0:G.path)===i().path,J=j.data.file&&v(h).has(j.data.file.path);se(this).attr("r",5).attr("stroke-width",X||J?3:2),A()}});const N=k.append("g").attr("class","labels");M.forEach((O,j)=>{const G=O.node,X=G.depth===0?"📁 root":G.data.name,J=G.depth===0?12:G.data.isFile?10:9;N.append("text").attr("x",O.x+(O.isRightSide?0:O.width)).attr("y",O.y+O.height/2).attr("dy","0.35em").attr("text-anchor",O.isRightSide?"start":"end").text(X).attr("fill",()=>{var lt;if(G.depth===0)return"#a78bfa";const K=i()&&((lt=G.data.file)==null?void 0:lt.path)===i().path,at=G.data.file&&v(h).has(G.data.file.path);return K?"#06b6d4":at?"#f59e0b":"#e2e8f0"}).attr("font-size",`${J}px`).attr("font-family","ui-monospace, monospace").attr("font-weight",G.depth===0?"600":"400").attr("cursor",G.data.isFile?"pointer":"default").style("dominant-baseline","middle").on("click",()=>{G.data.isFile&&G.data.file&&t.onFileSelect&&t.onFileSelect(G.data.file)}).on("mouseenter",function(K){G.data.isFile&&G.data.file&&(se(this).attr("fill","#06b6d4").style("text-decoration","underline"),C(K,G.data.file))}).on("mouseleave",function(){var K;if(G.data.isFile){const at=i()&&((K=G.data.file)==null?void 0:K.path)===i().path,lt=G.data.file&&v(h).has(G.data.file.path);se(this).attr("fill",at?"#06b6d4":lt?"#f59e0b":"#e2e8f0").style("text-decoration","none"),A()}})})}let g=ae(!1),b=ae(null),y=ae(0),x=ae(0);function C(q,F){let z=0,D=0,_=!1;if(F.oldContent&&F.newContent){const T=V_(F.oldContent,F.newContent);z=T.filter(k=>k.type==="add").length,D=T.filter(k=>k.type==="remove").length,_=!0}else F.operation==="write"&&F.newContent?(z=F.newContent.split(`
|
|
7
|
+
`).length,_=!0):F.operation==="read"&&(_=!1);et(b,{path:F.path,additions:z,deletions:D,operation:F.operation,hasContent:_},!0),et(y,q.clientX+15),et(x,q.clientY+15),et(g,!0)}function A(){et(g,!1)}function B(){l&&n&&se(n).transition().duration(750).call(l.transform,Dh)}var w=wC(),E=$(w);{var I=q=>{var F=bC();Z(q,F)},Y=q=>{var F=kC(),z=Ee(F);Xa(z,J=>n=J,()=>n);var D=H(z,2),_=$(D);_.__click=B,L(D);var T=H(D,2),k=H($(T),2),S=H($(k),2),M=$(S);Ji(2),L(S);var W=H(S,2),N=$(W);Ji(2),L(W);var O=H(W,2),j=$(O);Ji(2),L(O),Ji(4),L(k),L(T);var G=H(T,2);{var X=J=>{var K=_C(),at=$(K),lt=$(at,!0);L(at);var wt=H(at,2),_t=$(wt),ot=$(_t,!0);L(_t),L(wt);var Ct=H(wt,2);{var zt=gt=>{var Mt=xC(),kt=$(Mt),St=$(kt),Tt=$(St);L(St),Ji(2),L(kt);var Et=H(kt,2);{var ht=Lt=>{var fe=yC(),oe=$(fe),me=$(oe);L(oe),Ji(2),L(fe),xt(()=>tt(me,`-${v(b).deletions??""}`)),Z(Lt,fe)};mt(Et,Lt=>{v(b).deletions>0&&Lt(ht)})}L(Mt),xt(()=>tt(Tt,`+${v(b).additions??""}`)),Z(gt,Mt)},Ht=gt=>{var Mt=vC(),kt=$(Mt,!0);L(Mt),xt(()=>tt(kt,v(b).operation==="read"?"Read-only operation":"No diff available")),Z(gt,Mt)};mt(Ct,gt=>{v(b).hasContent?gt(zt):gt(Ht,!1)})}L(K),xt(()=>{Di(K,`left: ${v(y)??""}px; top: ${v(x)??""}px; min-width: 250px;`),tt(lt,v(b).path),Ae(_t,1,`px-2 py-0.5 rounded text-[10px] font-medium uppercase
|
|
8
|
+
${v(b).operation==="read"?"bg-blue-500/20 text-blue-300 border border-blue-500/30":""}
|
|
9
|
+
${v(b).operation==="write"?"bg-green-500/20 text-green-300 border border-green-500/30":""}
|
|
10
|
+
${v(b).operation==="edit"?"bg-amber-500/20 text-amber-300 border border-amber-500/30":""}`,"svelte-1uw5zj"),tt(ot,v(b).operation)}),Z(J,K)};mt(G,J=>{v(g)&&v(b)&&J(X)})}xt((J,K,at,lt,wt,_t)=>{Ue(z,"width",v(o)),Ue(z,"height",v(s)),Di(M,`background: ${J??""}; border: 2px solid ${K??""}`),Di(N,`background: ${at??""}; border: 2px solid ${lt??""}`),Di(j,`background: ${wt??""}; border: 2px solid ${_t??""}`)},[()=>Ls("read"),()=>Ms("read"),()=>Ls("write"),()=>Ms("write"),()=>Ls("edit"),()=>Ms("edit")]),Z(q,F)};mt(E,q=>{r().length===0?q(I):q(Y,!1)})}L(w),Xa(w,q=>a=q,()=>a),Z(e,w),Dr()}Ur(["click"]);var SC=it("<span>Copied!</span>"),TC=aa('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg><!>',1),EC=it("<span> </span>"),AC=aa('<svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path></svg><!>',1),MC=it('<button type="button"><!></button>');function Ar(e,t){let r=We(t,"label",3,""),i=We(t,"size",3,"md"),n=We(t,"className",3,""),a=ae(!1),o=null;async function s(){try{await navigator.clipboard.writeText(t.text),et(a,!0),o&&clearTimeout(o),o=setTimeout(()=>{et(a,!1)},2e3)}catch(p){console.error("Failed to copy to clipboard:",p)}}const c={sm:"text-xs px-1.5 py-0.5",md:"text-sm px-2 py-1",lg:"text-base px-2.5 py-1.5"},l={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};var h=MC();h.__click=s;var u=$(h);{var f=p=>{var g=TC(),b=Ee(g),y=H(b);{var x=C=>{var A=SC();Z(C,A)};mt(y,C=>{r()&&C(x)})}xt(()=>Ae(b,0,l[i()])),Z(p,g)},d=p=>{var g=AC(),b=Ee(g),y=H(b);{var x=C=>{var A=EC(),B=$(A,!0);L(A),xt(()=>tt(B,r())),Z(C,A)};mt(y,C=>{r()&&C(x)})}xt(()=>Ae(b,0,l[i()])),Z(p,g)};mt(u,p=>{v(a)?p(f):p(d,!1)})}L(h),xt(()=>{Ae(h,1,`inline-flex items-center gap-1.5 rounded transition-colors font-medium
|
|
11
|
+
${c[i()]??""}
|
|
12
|
+
${v(a)?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300":"bg-slate-100 dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600"}
|
|
13
|
+
${n()??""}`),Ue(h,"title",v(a)?"Copied!":"Copy to clipboard")}),Z(e,h)}Ur(["click"]);var LC=it('<div class="text-center py-12 text-slate-600 dark:text-slate-400"><svg class="w-16 h-16 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg> <p class="text-lg mb-2 font-medium">No files touched yet</p> <p class="text-sm text-slate-500 dark:text-slate-500">Files that Claude reads, writes, or edits will appear here</p></div>'),BC=it('<div><button class="text-xl"> </button> <button class="text-slate-700 dark:text-slate-300 truncate font-mono text-xs text-left"> </button> <button class="text-center"><span> </span></button> <button class="text-slate-700 dark:text-slate-300 font-mono text-[11px] text-right"> </button> <div class="flex items-center justify-end"><!></div></div>'),$C=it('<div class="grid grid-cols-[50px_1fr_100px_120px_auto] gap-3 px-4 py-2 bg-slate-50 dark:bg-slate-900 border-b border-slate-200 dark:border-slate-700 text-xs font-semibold text-slate-700 dark:text-slate-300 sticky top-0 transition-colors"><div></div> <div>Filename</div> <div>Operation</div> <div class="text-right">Timestamp</div> <div class="text-right pr-2">Actions</div></div> <div tabindex="0" role="list" aria-label="File list" class="focus:outline-none overflow-y-auto max-h-[calc(100vh-280px)]"></div>',1),RC=it('<div class="h-full overflow-y-auto"><!></div>'),OC=it('<div class="h-full"><!></div>'),NC=it('<div class="flex flex-col h-full bg-white dark:bg-slate-900"><div class="flex items-center justify-between px-6 py-3 bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><div class="flex items-center gap-3 flex-1"><input type="text" placeholder="Filter by filename..." class="px-3 py-1.5 text-sm rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 text-slate-900 dark:text-slate-100 placeholder-slate-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-transparent transition-colors w-64"/></div> <div class="flex items-center gap-2"><button title="Table View">📋 Table</button> <button title="Radial Tree View">🌳 Tree</button> <span class="text-sm text-slate-700 dark:text-slate-300 ml-2"> </span></div></div> <div class="flex-1 overflow-hidden"><!></div></div>');function IC(e,t){Ir(t,!0);let r=We(t,"selectedStream",3,""),i=We(t,"selectedFile",15,null),n=We(t,"fileContent",15,""),a=We(t,"contentLoading",15,!1),o=ae("table"),s=ae(""),c=ae(Bi([])),l=ae("");const h=new Map;let u=we(()=>{const S=new Map;return[...v(c)].reverse().forEach(M=>{S.set(M.path,M)}),Array.from(S.values()).sort((M,W)=>{const N=typeof M.timestamp=="string"?new Date(M.timestamp).getTime():M.timestamp;return(typeof W.timestamp=="string"?new Date(W.timestamp).getTime():W.timestamp)-N})}),f=we(()=>{let S=v(u);if(r()!==""&&(S=S.filter(M=>M.sessionId===r())),v(l).trim()!==""){const M=v(l).toLowerCase();S=S.filter(W=>W.path.toLowerCase().includes(M)||W.name.toLowerCase().includes(M))}return S}),d=null;tl(async()=>{console.log("[FilesView] Mounted, subscribing to socket events");try{const M=await(await fetch("/api/working-directory")).json();M.success&&M.working_directory&&(et(s,M.working_directory,!0),console.log("[FilesView] Project root:",v(s)))}catch(S){console.error("[FilesView] Failed to fetch working directory:",S)}d=Xn.events.subscribe(S=>{S.forEach(async M=>{try{await p(M)}catch(W){console.error("[FilesView] Error processing tool event:",W)}})})}),l_(()=>{d&&(d(),d=null)});async function p(S){var M,W;try{const N=S.data,O=N&&typeof N=="object"&&!Array.isArray(N)?N.subtype:void 0,j=S.subtype||O;if(j==="post_tool"){const Ht=N&&typeof N=="object"&&!Array.isArray(N)?N:null,gt=Ht==null?void 0:Ht.tool_name;if((gt?Ju(gt):null)==="read"){const kt=Qu(N),St=Ht==null?void 0:Ht.tool_result;kt&&St&&typeof St=="string"&&(h.set(kt,St),console.log("[FilesView] Cached read content:",kt))}return}if(j!=="pre_tool")return;const G=N&&typeof N=="object"&&!Array.isArray(N)?N:null,X=G==null?void 0:G.tool_name;if(!X)return;const J=Ju(X);if(!J)return;const K=Qu(N);if(!K||v(c).some(Ht=>Ht.eventId===S.id))return;const{oldContent:lt,newContent:wt}=Y_(N);let _t=lt;if((J==="write"||J==="edit")&&!lt&&(_t=h.get(K),!_t&&J==="write"))try{_t=await Ku(K),console.log("[FilesView] Fetched old content for write operation:",K)}catch{console.log("[FilesView] Could not fetch old content (might be new file):",K)}const ot=S.session_id||S.sessionId||((M=S.data)==null?void 0:M.session_id)||((W=S.data)==null?void 0:W.sessionId)||S.source||void 0,Ct=G_(K),zt={path:K,name:Ct,operation:J,timestamp:S.timestamp,toolName:X,eventId:S.id,sessionId:ot,oldContent:_t,newContent:wt};console.log("[FilesView] File touched:",zt),et(c,[...v(c),zt],!0),(J==="write"||J==="edit")&&wt&&h.set(K,wt)}catch(N){console.error("[FilesView] Error in processToolEvent:",N)}}async function g(S){var M;if(((M=i())==null?void 0:M.path)===S.path){i(null),n("");return}i(S),a(!0);try{n(await Ku(S.path)),console.log("[FilesView] Loaded file content:",{path:S.path,size:n().length,hasOldContent:!!S.oldContent,hasNewContent:!!S.newContent})}catch(W){console.error("[FilesView] Error loading file content:",W),n(`Error loading file: ${W instanceof Error?W.message:"Unknown error"}`)}finally{a(!1)}}function b(S){switch(S){case"read":return"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300";case"write":return"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300";case"edit":return"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300";default:return"bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300"}}function y(S){return(typeof S=="string"?new Date(S):new Date(S)).toLocaleTimeString()}function x(S){const M=S.split(".");return M.length>1?`.${M.pop()}`:""}function C(S){const M=x(S);return[".py"].includes(M)?"🐍":[".js",".ts",".jsx",".tsx"].includes(M)?"📜":[".json"].includes(M)?"📋":[".md",".txt"].includes(M)?"📄":[".css",".scss",".sass"].includes(M)?"🎨":[".html",".svelte",".vue"].includes(M)?"🌐":[".sh",".bash"].includes(M)?"⚙️":[".yml",".yaml"].includes(M)?"📝":"📄"}var A=NC(),B=$(A),w=$(B),E=$(w);Ep(E),L(w);var I=H(w,2),Y=$(I);Y.__click=()=>et(o,"table");var q=H(Y,2);q.__click=()=>et(o,"tree");var F=H(q,2),z=$(F);L(F),L(I),L(B);var D=H(B,2),_=$(D);{var T=S=>{var M=RC(),W=$(M);{var N=j=>{var G=LC();Z(j,G)},O=j=>{var G=$C(),X=H(Ee(G),2);hr(X,23,()=>v(f),J=>J.eventId,(J,K,at)=>{var lt=BC(),wt=$(lt);wt.__click=()=>g(v(K));var _t=$(wt,!0);L(wt);var ot=H(wt,2);ot.__click=()=>g(v(K));var Ct=$(ot,!0);L(ot);var zt=H(ot,2);zt.__click=()=>g(v(K));var Ht=$(zt),gt=$(Ht,!0);L(Ht),L(zt);var Mt=H(zt,2);Mt.__click=()=>g(v(K));var kt=$(Mt,!0);L(Mt);var St=H(Mt,2),Tt=$(St);Ar(Tt,{get text(){return v(K).path},size:"sm"}),L(St),L(lt),xt((Et,ht,Lt)=>{var fe;Ae(lt,1,`w-full text-left px-4 py-2.5 transition-colors border-l-4 grid grid-cols-[50px_1fr_100px_120px_auto] gap-3 items-center text-xs
|
|
14
|
+
${((fe=i())==null?void 0:fe.path)===v(K).path?"bg-cyan-50 dark:bg-cyan-500/20 border-l-cyan-500 dark:border-l-cyan-400 ring-1 ring-cyan-300 dark:ring-cyan-500/30":`border-l-transparent ${v(at)%2===0?"bg-slate-50 dark:bg-slate-800/40":"bg-white dark:bg-slate-800/20"} hover:bg-slate-100 dark:hover:bg-slate-700/30`}`),tt(_t,Et),Ue(ot,"title",v(K).path),tt(Ct,v(K).name),Ae(Ht,1,`px-2 py-0.5 rounded text-[10px] font-medium uppercase ${ht??""}`),tt(gt,v(K).operation),tt(kt,Lt)},[()=>C(v(K).path),()=>b(v(K).operation),()=>y(v(K).timestamp)]),Z(J,lt)}),L(X),Z(j,G)};mt(W,j=>{v(f).length===0?j(N):j(O,!1)})}L(M),Z(S,M)},k=S=>{var M=OC(),W=$(M);CC(W,{get files(){return v(f)},get selectedFile(){return i()},onFileSelect:g}),L(M),Z(S,M)};mt(_,S=>{v(o)==="table"?S(T):S(k,!1)})}L(D),L(A),xt(()=>{Ae(Y,1,`px-3 py-1.5 text-sm rounded-lg transition-colors font-medium
|
|
15
|
+
${v(o)==="table"?"bg-cyan-500 text-white":"bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-300 dark:hover:bg-slate-600"}`),Ae(q,1,`px-3 py-1.5 text-sm rounded-lg transition-colors font-medium
|
|
16
|
+
${v(o)==="tree"?"bg-cyan-500 text-white":"bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-300 dark:hover:bg-slate-600"}`),tt(z,`${v(f).length??""} files`)}),C_(E,()=>v(l),S=>et(l,S)),Z(e,A),Dr()}Ur(["click"]);var DC=it('<div class="text-center py-12 text-slate-600 dark:text-slate-400"><svg class="w-16 h-16 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path></svg> <p class="text-lg mb-2 font-medium">No agents detected</p> <p class="text-sm text-slate-500 dark:text-slate-500">Waiting for agent activity...</p></div>'),FC=aa('<svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>'),PC=aa('<svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>'),zC=it('<div role="button" tabindex="0" class="flex-shrink-0 w-4 h-4 flex items-center justify-center text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 cursor-pointer"><!></div>'),WC=it('<div class="w-4"></div>'),qC=it('<code class="text-xs text-slate-500 dark:text-slate-500 font-mono"> </code>'),HC=it('<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-blue-500/20 text-blue-600 dark:text-blue-400 border border-blue-500/30"> </span>'),jC=it('<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-purple-500/20 text-purple-600 dark:text-purple-400 border border-purple-500/30"> </span>'),UC=it('<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-slate-500/20 text-slate-600 dark:text-slate-400 border border-slate-500/30"> </span>'),GC=it('<div role="button" tabindex="0"><!> <div class="flex-1 flex items-center gap-3"><span class="text-base"> </span> <span class="text-sm"> </span> <span class="font-semibold text-slate-900 dark:text-slate-100"> </span> <!> <div class="flex items-center gap-2"><!> <!> <!></div> <span class="text-xs text-slate-600 dark:text-slate-400 font-mono ml-auto"> </span></div></div>'),YC=it('<div class="py-2"></div>'),VC=it('<div class="flex flex-col h-full bg-white dark:bg-slate-900"><div class="flex items-center justify-between px-6 py-3 bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><div class="flex items-center gap-4"><span class="text-sm text-slate-700 dark:text-slate-300"> </span> <span class="text-sm text-slate-700 dark:text-slate-300"> </span> <span class="text-sm text-slate-700 dark:text-slate-300"> </span> <span class="text-sm text-slate-700 dark:text-slate-300"> </span></div></div> <div class="flex-1 overflow-y-auto"><!></div></div>');function XC(e,t){Ir(t,!0);let r=We(t,"selectedAgent",15,null);We(t,"selectedStream",3,"");let i=ae(Bi(new Set));function n(z){const D=new Set(v(i));D.has(z)?D.delete(z):D.add(z),et(i,D,!0)}function a(z){r(z)}function o(z){switch(z){case"active":return"🔵";case"completed":return"✅";case"error":return"❌";default:return"❓"}}function s(z){const D=z.toLowerCase();return D==="pm"?"🤖":D.includes("research")?"🔍":D.includes("engineer")||D.includes("svelte")?"🛠️":D.includes("qa")||D.includes("test")?"✅":D.includes("ops")||D.includes("local")?"⚙️":D.includes("security")?"🔒":D.includes("data")?"📊":"👤"}function c(z){return z.split(/[-_]/).map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(" ")}function l(z,D){const T=(D||Date.now())-z;if(T<1e3)return`${T}ms`;if(T<6e4)return`${(T/1e3).toFixed(1)}s`;{const k=Math.floor(T/6e4),S=Math.floor(T%6e4/1e3);return`${k}m ${S}s`}}function h(z,D=0){const _=[{agent:z,depth:D}];return!v(i).has(z.id)&&z.children.length>0&&z.children.forEach(T=>{_.push(...h(T,D+1))}),_}let u=we(()=>h(t.rootAgent)),f=we(()=>{const z=h(t.rootAgent,0),D=z.length,_=z.filter(S=>S.agent.status==="active").length,T=z.reduce((S,M)=>S+M.agent.toolCalls.length,0),k=z.reduce((S,M)=>S+M.agent.todos.length,0);return{totalAgents:D,activeAgents:_,totalTools:T,totalTodos:k}});var d=VC(),p=$(d),g=$(p),b=$(g),y=$(b);L(b);var x=H(b,2),C=$(x);L(x);var A=H(x,2),B=$(A);L(A);var w=H(A,2),E=$(w);L(w),L(g),L(p);var I=H(p,2),Y=$(I);{var q=z=>{var D=DC();Z(z,D)},F=z=>{var D=YC();hr(D,23,()=>v(u),({agent:_,depth:T})=>_.id,(_,T,k)=>{let S=()=>v(T).agent,M=()=>v(T).depth;var W=GC();W.__click=()=>a(S()),W.__keydown=ht=>{(ht.key==="Enter"||ht.key===" ")&&(ht.preventDefault(),a(S()))};var N=$(W);{var O=ht=>{var Lt=zC();Lt.__click=ee=>{ee.stopPropagation(),n(S().id)},Lt.__keydown=ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),ee.stopPropagation(),n(S().id))};var fe=$(Lt);{var oe=ee=>{var yt=FC();Z(ee,yt)},me=ee=>{var yt=PC();Z(ee,yt)};mt(fe,ee=>{v(i).has(S().id)?ee(oe):ee(me,!1)})}L(Lt),Z(ht,Lt)},j=ht=>{var Lt=WC();Z(ht,Lt)};mt(N,ht=>{S().children.length>0?ht(O):ht(j,!1)})}var G=H(N,2),X=$(G),J=$(X,!0);L(X);var K=H(X,2),at=$(K,!0);L(K);var lt=H(K,2),wt=$(lt,!0);L(lt);var _t=H(lt,2);{var ot=ht=>{var Lt=qC(),fe=$(Lt,!0);L(Lt),xt(oe=>{Ue(Lt,"title",`Session ID: ${S().sessionId??""}`),tt(fe,oe)},[()=>S().sessionId.slice(0,8)]),Z(ht,Lt)};mt(_t,ht=>{S().sessionId!=="pm"&&S().sessionId!==S().name&&ht(ot)})}var Ct=H(_t,2),zt=$(Ct);{var Ht=ht=>{var Lt=HC(),fe=$(Lt);L(Lt),xt(()=>tt(fe,`${S().toolCalls.length??""} tools`)),Z(ht,Lt)};mt(zt,ht=>{S().toolCalls.length>0&&ht(Ht)})}var gt=H(zt,2);{var Mt=ht=>{var Lt=jC(),fe=$(Lt);L(Lt),xt(()=>tt(fe,`${S().todos.length??""} todos`)),Z(ht,Lt)};mt(gt,ht=>{S().todos.length>0&&ht(Mt)})}var kt=H(gt,2);{var St=ht=>{var Lt=UC(),fe=$(Lt);L(Lt),xt(()=>tt(fe,`${S().children.length??""} sub-agents`)),Z(ht,Lt)};mt(kt,ht=>{S().children.length>0&&ht(St)})}L(Ct);var Tt=H(Ct,2),Et=$(Tt,!0);L(Tt),L(G),L(W),xt((ht,Lt,fe,oe)=>{var me;Ae(W,1,`w-full text-left px-4 py-2.5 transition-colors border-l-4 flex items-center gap-2 text-sm cursor-pointer
|
|
17
|
+
${((me=r())==null?void 0:me.id)===S().id?"bg-cyan-50 dark:bg-cyan-500/20 border-l-cyan-500 dark:border-l-cyan-400 ring-1 ring-cyan-300 dark:ring-cyan-500/30":`border-l-transparent ${v(k)%2===0?"bg-slate-50 dark:bg-slate-800/40":"bg-white dark:bg-slate-800/20"} hover:bg-slate-100 dark:hover:bg-slate-700/30`}`),Di(W,`padding-left: ${M()*24+16}px`),Ue(X,"title",S().name),tt(J,ht),tt(at,Lt),tt(wt,fe),tt(Et,oe)},[()=>s(S().name),()=>o(S().status),()=>c(S().name),()=>l(S().startTime,S().endTime)]),Z(_,W)}),L(D),Z(z,D)};mt(Y,z=>{t.rootAgent.children.length===0?z(q):z(F,!1)})}L(I),L(d),xt(()=>{tt(y,`${v(f).totalAgents??""} agents`),tt(C,`${v(f).activeAgents??""} active`),tt(B,`${v(f).totalTools??""} tools`),tt(E,`${v(f).totalTodos??""} todos`)}),Z(e,d),Dr()}Ur(["click","keydown"]);var ZC=it('<div class="flex items-center justify-center h-full text-slate-500 dark:text-slate-400"><div class="text-center"><svg class="w-16 h-16 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg> <p class="text-lg">Select an agent to view details</p></div></div>'),KC=it('<button class="mt-2 text-xs text-blue-600 dark:text-blue-400 hover:underline"> </button>'),QC=it('<div class="mb-6"><div class="flex items-center justify-between mb-3"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 flex items-center gap-2">📝 User Request</h3> <!></div> <div class="p-3 bg-blue-50 dark:bg-blue-900/20 rounded border border-blue-200 dark:border-blue-800"><p class="text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap"> </p> <!></div></div>'),JC=it('<p class="text-sm text-slate-600 dark:text-slate-400 mb-2 italic"> </p>'),tS=it('<button class="mt-2 text-xs text-purple-600 dark:text-purple-400 hover:underline"> </button>'),eS=it('<div class="mb-6"><div class="flex items-center justify-between mb-3"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 flex items-center gap-2">📤 Delegation Prompt</h3> <!></div> <!> <div class="p-3 bg-purple-50 dark:bg-purple-900/20 rounded border border-purple-200 dark:border-purple-800"><p class="text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap"> </p> <!></div></div>'),rS=it('<span class="text-xs px-2 py-0.5 rounded bg-amber-200 dark:bg-amber-700 text-slate-700 dark:text-slate-300"> </span>'),iS=it('<div class="mb-2 text-xs text-slate-600 dark:text-slate-400 font-mono flex items-center gap-2"> <!></div>'),nS=it('<button class="mt-2 text-xs text-amber-600 dark:text-amber-400 hover:underline"> </button>'),aS=it('<div class="p-4 bg-amber-50 dark:bg-amber-900/20 rounded border border-amber-200 dark:border-amber-800"><div class="flex items-center justify-between mb-3 pb-2 border-b border-amber-200 dark:border-amber-800"><div class="flex items-center gap-2"><span> </span> <span class="text-xs text-slate-600 dark:text-slate-400 font-mono"> </span> <!></div> <span> </span></div> <!> <div class="relative"><div class="text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap font-mono bg-slate-50 dark:bg-slate-800/40 p-3 rounded"> </div> <div class="absolute top-2 right-2"><!></div></div> <!></div>'),sS=it('<div class="mb-6"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-3 flex items-center gap-2">📋 Work Plans <span class="text-sm font-normal text-slate-600 dark:text-slate-400"> </span></h3> <div class="space-y-3"></div></div>'),oS=it('<button class="mt-2 text-xs text-blue-600 dark:text-blue-400 hover:underline"> </button>'),lS=it('<div class="p-3 bg-slate-50 dark:bg-slate-800/40 rounded border border-slate-200 dark:border-slate-700 relative"><div class="flex items-center justify-between mb-2"><span class="text-xs text-slate-600 dark:text-slate-400 font-mono"> </span> <div class="flex items-center gap-2"><span class="text-xs px-2 py-0.5 rounded bg-slate-200 dark:bg-slate-700 text-slate-600 dark:text-slate-400"> </span> <!></div></div> <p class="text-sm text-slate-700 dark:text-slate-300 whitespace-pre-wrap"> </p> <!></div>'),cS=it('<div class="mb-6"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-3 flex items-center gap-2">💬 Responses <span class="text-sm font-normal text-slate-600 dark:text-slate-400"> </span></h3> <div class="space-y-3"></div></div>'),hS=it('<p class="text-sm text-slate-500 dark:text-slate-500 italic">No tool calls</p>'),uS=it('<span class="text-xs px-1.5 py-0.5 rounded bg-slate-200 dark:bg-slate-700 text-slate-600 dark:text-slate-400 font-semibold"> </span>'),dS=it('<button class="w-full p-3 bg-slate-50 dark:bg-slate-800/40 rounded border border-slate-200 dark:border-slate-700 hover:bg-slate-100 dark:hover:bg-slate-700/50 hover:border-slate-300 dark:hover:border-slate-600 transition-colors cursor-pointer text-left" title="Click to view tool details"><div class="flex items-start justify-between gap-3 mb-2"><div class="flex-1"><div class="flex items-center gap-2 mb-1"><span> </span> <span class="font-mono text-sm px-2 py-0.5 rounded bg-slate-100 dark:bg-black/30 text-blue-600 dark:text-blue-400 font-medium"> </span> <!> <span class="text-xs text-slate-400 dark:text-slate-500 ml-auto">Click to view details →</span></div> <p class="text-sm text-slate-700 dark:text-slate-300"> </p></div> <div class="text-right"><div class="text-xs text-slate-600 dark:text-slate-400 font-mono"> </div></div></div></button>'),fS=it('<div class="space-y-2"></div>'),pS=it('<p class="text-sm text-slate-500 dark:text-slate-500 italic">No todo updates</p>'),gS=it('<p class="text-xs text-blue-600 dark:text-blue-400 mt-1 italic"> </p>'),mS=it('<div class="flex items-start gap-2.5"><span> </span> <div class="flex-1 min-w-0"><p class="text-sm text-slate-900 dark:text-slate-100 font-medium"> </p> <!></div></div>'),bS=it('<div class="p-4 bg-slate-50 dark:bg-slate-800/40 rounded border border-slate-200 dark:border-slate-700"><div class="flex items-center justify-between mb-3 pb-2 border-b border-slate-200 dark:border-slate-700"><span class="text-xs text-slate-600 dark:text-slate-400 font-mono"> </span> <span class="text-xs text-slate-500 dark:text-slate-500"> </span></div> <div class="space-y-2.5"></div></div>'),yS=it('<div class="space-y-4"></div>'),xS=it('<div class="p-3 bg-slate-50 dark:bg-slate-800/40 rounded border border-slate-200 dark:border-slate-700"><div class="flex items-center justify-between"><div class="flex items-center gap-2"><span class="text-base"> </span> <span class="font-semibold text-slate-900 dark:text-slate-100"> </span> <span class="text-sm text-slate-600 dark:text-slate-400"> </span></div> <span class="text-sm text-slate-600 dark:text-slate-400 capitalize"> </span></div></div>'),vS=it('<div class="mb-6"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-3 flex items-center gap-2">Delegated Agents <span class="text-sm font-normal text-slate-600 dark:text-slate-400"> </span></h3> <div class="space-y-2"></div></div>'),_S=it('<div class="flex flex-col h-full bg-white dark:bg-slate-900"><div class="px-6 py-4 bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><h2 class="text-xl font-bold text-slate-900 dark:text-slate-100 mb-2 flex items-center gap-2"><span> </span> <span> </span></h2> <div class="flex flex-wrap gap-3 text-sm text-slate-600 dark:text-slate-400"><div class="flex items-center gap-2"><span class="font-semibold">Session:</span> <code class="px-2 py-0.5 rounded bg-slate-200 dark:bg-slate-700 text-[11px] font-mono"> </code> <!></div> <div class="flex items-center gap-2"><span class="font-semibold">Status:</span> <span class="capitalize"> </span></div> <div class="flex items-center gap-2"><span class="font-semibold">Duration:</span> <span> </span></div></div></div> <div class="flex-1 overflow-y-auto p-6"><!> <!> <!> <!> <div class="mb-6"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-3 flex items-center gap-2">Tool Calls <span class="text-sm font-normal text-slate-600 dark:text-slate-400"> </span></h3> <!></div> <div class="mb-6"><h3 class="text-lg font-semibold text-slate-900 dark:text-slate-100 mb-3 flex items-center gap-2">📋 Todo List <span class="text-sm font-normal text-slate-600 dark:text-slate-400"> </span></h3> <!></div> <!></div></div>');function kS(e,t){Ir(t,!0);function r(C){return new Date(C).toLocaleTimeString()}function i(C){if(C===null)return"—";if(C<1e3)return`${C}ms`;if(C<6e4)return`${(C/1e3).toFixed(2)}s`;{const A=Math.floor(C/6e4),B=(C%6e4/1e3).toFixed(0);return`${A}m ${B}s`}}function n(C){switch(C){case"pending":return"⏳";case"success":return"✅";case"error":return"❌";default:return"❓"}}function a(C){switch(C){case"pending":return"text-yellow-600 dark:text-yellow-400";case"success":return"text-green-600 dark:text-green-400";case"error":return"text-red-600 dark:text-red-400";default:return"text-slate-600 dark:text-slate-400"}}function o(C){switch(C){case"pending":return"⏳";case"in_progress":return"🔄";case"completed":return"✅";default:return"❓"}}function s(C){switch(C){case"pending":return"text-slate-600 dark:text-slate-400";case"in_progress":return"text-blue-600 dark:text-blue-400";case"completed":return"text-green-600 dark:text-green-400";default:return"text-slate-600 dark:text-slate-400"}}function c(C){return C.split(/[-_]/).map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" ")}function l(C){const A=C.toLowerCase();return A==="pm"?"🤖":A.includes("research")?"🔍":A.includes("engineer")||A.includes("svelte")?"🛠️":A.includes("qa")||A.includes("test")?"✅":A.includes("ops")||A.includes("local")?"⚙️":A.includes("security")?"🔒":A.includes("data")?"📊":"👤"}function h(C,A=200){return C.length<=A?{truncated:C,isTruncated:!1}:{truncated:C.slice(0,A)+"...",isTruncated:!0}}let u=Bi({userPrompt:!1,delegationPrompt:!1});function f(C){u[C]=!u[C]}function d(C){switch(C){case"draft":return"📝";case"approved":return"✅";case"completed":return"🎉";default:return"📋"}}function p(C){switch(C){case"draft":return"text-slate-600 dark:text-slate-400";case"approved":return"text-green-600 dark:text-green-400";case"completed":return"text-blue-600 dark:text-blue-400";default:return"text-slate-600 dark:text-slate-400"}}var g=Ge(),b=Ee(g);{var y=C=>{var A=ZC();Z(C,A)},x=C=>{var A=_S(),B=$(A),w=$(B),E=$(w),I=$(E,!0);L(E);var Y=H(E,2),q=$(Y,!0);L(Y),L(w);var F=H(w,2),z=$(F),D=H($(z),2),_=$(D,!0);L(D);var T=H(D,2);Ar(T,{get text(){return t.agent.sessionId},size:"sm"}),L(z);var k=H(z,2),S=H($(k),2),M=$(S,!0);L(S),L(k);var W=H(k,2),N=H($(W),2),O=$(N,!0);L(N),L(W),L(F),L(B);var j=H(B,2),G=$(j);{var X=yt=>{const Gt=we(()=>{const{truncated:Qt,isTruncated:Zt}=h(t.agent.userPrompt);return{truncated:Qt,isTruncated:Zt}});var Kt=QC(),Nt=$(Kt),re=H($(Nt),2);Ar(re,{get text(){return t.agent.userPrompt},label:"Copy",size:"sm"}),L(Nt);var be=H(Nt,2),ue=$(be),Ft=$(ue,!0);L(ue);var te=H(ue,2);{var pe=Qt=>{var Zt=KC();Zt.__click=()=>f("userPrompt");var Yt=$(Zt,!0);L(Zt),xt(()=>tt(Yt,u.userPrompt?"Show less":"Show more")),Z(Qt,Zt)};mt(te,Qt=>{v(Gt).isTruncated&&Qt(pe)})}L(be),L(Kt),xt(()=>tt(Ft,u.userPrompt||!v(Gt).isTruncated?t.agent.userPrompt:v(Gt).truncated)),Z(yt,Kt)};mt(G,yt=>{t.agent.userPrompt&&yt(X)})}var J=H(G,2);{var K=yt=>{const Gt=we(()=>{const{truncated:Yt,isTruncated:he}=h(t.agent.delegationPrompt);return{truncated:Yt,isTruncated:he}});var Kt=eS(),Nt=$(Kt),re=H($(Nt),2);Ar(re,{get text(){return t.agent.delegationPrompt},label:"Copy",size:"sm"}),L(Nt);var be=H(Nt,2);{var ue=Yt=>{var he=JC(),ge=$(he,!0);L(he),xt(()=>tt(ge,t.agent.delegationDescription)),Z(Yt,he)};mt(be,Yt=>{t.agent.delegationDescription&&Yt(ue)})}var Ft=H(be,2),te=$(Ft),pe=$(te,!0);L(te);var Qt=H(te,2);{var Zt=Yt=>{var he=tS();he.__click=()=>f("delegationPrompt");var ge=$(he,!0);L(he),xt(()=>tt(ge,u.delegationPrompt?"Show less":"Show more")),Z(Yt,he)};mt(Qt,Yt=>{v(Gt).isTruncated&&Yt(Zt)})}L(Ft),L(Kt),xt(()=>tt(pe,u.delegationPrompt||!v(Gt).isTruncated?t.agent.delegationPrompt:v(Gt).truncated)),Z(yt,Kt)};mt(J,yt=>{t.agent.delegationPrompt&&yt(K)})}var at=H(J,2);{var lt=yt=>{var Gt=sS(),Kt=$(Gt),Nt=H($(Kt)),re=$(Nt);L(Nt),L(Kt);var be=H(Kt,2);hr(be,21,()=>t.agent.plans,di,(ue,Ft)=>{const te=we(()=>`plan-${v(Ft).timestamp}`),pe=we(()=>{const{truncated:Fe,isTruncated:Le}=h(v(Ft).content,500);return{truncated:Fe,isTruncated:Le}});var Qt=aS(),Zt=$(Qt),Yt=$(Zt),he=$(Yt),ge=$(he,!0);L(he);var Ie=H(he,2),Me=$(Ie,!0);L(Ie);var R=H(Ie,2);{var V=Fe=>{var Le=rS(),Ze=$(Le,!0);L(Le),xt(()=>tt(Ze,v(Ft).mode==="entered"?"Entered Plan Mode":"Exited Plan Mode")),Z(Fe,Le)};mt(R,Fe=>{v(Ft).mode&&Fe(V)})}L(Yt);var Q=H(Yt,2),pt=$(Q,!0);L(Q),L(Zt);var le=H(Zt,2);{var ie=Fe=>{var Le=iS(),Ze=$(Le),Qe=H(Ze);Ar(Qe,{get text(){return v(Ft).planFile},size:"sm"}),L(Le),xt(()=>tt(Ze,`📄 ${v(Ft).planFile??""} `)),Z(Fe,Le)};mt(le,Fe=>{v(Ft).planFile&&Fe(ie)})}var ct=H(le,2),ut=$(ct),Dt=$(ut,!0);L(ut);var Te=H(ut,2),ye=$(Te);Ar(ye,{get text(){return v(Ft).content},size:"sm"}),L(Te),L(ct);var Ye=H(ct,2);{var Tr=Fe=>{var Le=nS();Le.__click=()=>f(v(te));var Ze=$(Le,!0);L(Le),xt(()=>tt(Ze,u[v(te)]?"Show less":"Show more")),Z(Fe,Le)};mt(Ye,Fe=>{v(pe).isTruncated&&Fe(Tr)})}L(Qt),xt((Fe,Le,Ze,Qe)=>{Ae(he,1,`${Fe??""} text-lg`),tt(ge,Le),tt(Me,Ze),Ae(Q,1,`text-xs capitalize px-2 py-0.5 rounded ${Qe??""}`),tt(pt,v(Ft).status),tt(Dt,u[v(te)]||!v(pe).isTruncated?v(Ft).content:v(pe).truncated)},[()=>p(v(Ft).status),()=>d(v(Ft).status),()=>r(v(Ft).timestamp),()=>p(v(Ft).status)]),Z(ue,Qt)}),L(be),L(Gt),xt(()=>tt(re,`(${t.agent.plans.length??""})`)),Z(yt,Gt)};mt(at,yt=>{t.agent.plans&&t.agent.plans.length>0&&yt(lt)})}var wt=H(at,2);{var _t=yt=>{var Gt=cS(),Kt=$(Gt),Nt=H($(Kt)),re=$(Nt);L(Nt),L(Kt);var be=H(Kt,2);hr(be,21,()=>t.agent.responses,ue=>ue.timestamp,(ue,Ft)=>{const te=we(()=>`response-${v(Ft).timestamp}`),pe=we(()=>{const{truncated:ie,isTruncated:ct}=h(v(Ft).content);return{truncated:ie,isTruncated:ct}});var Qt=lS(),Zt=$(Qt),Yt=$(Zt),he=$(Yt,!0);L(Yt);var ge=H(Yt,2),Ie=$(ge),Me=$(Ie,!0);L(Ie);var R=H(Ie,2);Ar(R,{get text(){return v(Ft).content},size:"sm"}),L(ge),L(Zt);var V=H(Zt,2),Q=$(V,!0);L(V);var pt=H(V,2);{var le=ie=>{var ct=oS();ct.__click=()=>f(v(te));var ut=$(ct,!0);L(ct),xt(()=>tt(ut,u[v(te)]?"Show less":"Show more")),Z(ie,ct)};mt(pt,ie=>{v(pe).isTruncated&&ie(le)})}L(Qt),xt(ie=>{tt(he,ie),tt(Me,v(Ft).type),tt(Q,u[v(te)]||!v(pe).isTruncated?v(Ft).content:v(pe).truncated)},[()=>r(v(Ft).timestamp)]),Z(ue,Qt)}),L(be),L(Gt),xt(()=>tt(re,`(${t.agent.responses.length??""})`)),Z(yt,Gt)};mt(wt,yt=>{t.agent.responses&&t.agent.responses.length>0&&yt(_t)})}var ot=H(wt,2),Ct=$(ot),zt=H($(Ct)),Ht=$(zt);L(zt),L(Ct);var gt=H(Ct,2);{var Mt=yt=>{var Gt=hS();Z(yt,Gt)},kt=yt=>{var Gt=fS();hr(Gt,21,()=>t.agent.groupedToolCalls,di,(Kt,Nt)=>{var re=dS();re.__click=()=>{var Q;return(Q=t.onToolClick)==null?void 0:Q.call(t,v(Nt).instances[0])};var be=$(re),ue=$(be),Ft=$(ue),te=$(Ft),pe=$(te,!0);L(te);var Qt=H(te,2),Zt=$(Qt,!0);L(Qt);var Yt=H(Qt,2);{var he=Q=>{var pt=uS(),le=$(pt);L(pt),xt(()=>tt(le,`${v(Nt).count??""} calls`)),Z(Q,pt)};mt(Yt,Q=>{v(Nt).count>1&&Q(he)})}Ji(2),L(Ft);var ge=H(Ft,2),Ie=$(ge,!0);L(ge),L(ue);var Me=H(ue,2),R=$(Me),V=$(R,!0);L(R),L(Me),L(be),L(re),xt((Q,pt,le)=>{Ae(te,1,`${Q??""} text-base`),tt(pe,pt),tt(Zt,v(Nt).toolName),tt(Ie,v(Nt).target),tt(V,le)},[()=>a(v(Nt).status),()=>n(v(Nt).status),()=>r(v(Nt).latestTimestamp)]),Z(Kt,re)}),L(Gt),Z(yt,Gt)};mt(gt,yt=>{t.agent.groupedToolCalls.length===0?yt(Mt):yt(kt,!1)})}L(ot);var St=H(ot,2),Tt=$(St),Et=H($(Tt)),ht=$(Et);L(Et),L(Tt);var Lt=H(Tt,2);{var fe=yt=>{var Gt=pS();Z(yt,Gt)},oe=yt=>{var Gt=yS();hr(Gt,21,()=>t.agent.todos,Kt=>Kt.id,(Kt,Nt)=>{var re=bS(),be=$(re),ue=$(be),Ft=$(ue);L(ue);var te=H(ue,2),pe=$(te);L(te),L(be);var Qt=H(be,2);hr(Qt,21,()=>v(Nt).todos,di,(Zt,Yt)=>{var he=mS(),ge=$(he),Ie=$(ge,!0);L(ge);var Me=H(ge,2),R=$(Me),V=$(R,!0);L(R);var Q=H(R,2);{var pt=le=>{var ie=gS(),ct=$(ie);L(ie),xt(()=>tt(ct,`→ ${v(Yt).activeForm??""}`)),Z(le,ie)};mt(Q,le=>{v(Yt).activeForm&&v(Yt).status==="in_progress"&&le(pt)})}L(Me),L(he),xt((le,ie)=>{Ae(ge,1,`${le??""} text-base leading-none mt-0.5`),Ue(ge,"title",v(Yt).status),tt(Ie,ie),tt(V,v(Yt).content)},[()=>s(v(Yt).status),()=>o(v(Yt).status)]),Z(Zt,he)}),L(Qt),L(re),xt(Zt=>{tt(Ft,`Updated: ${Zt??""}`),tt(pe,`${v(Nt).todos.length??""} item${v(Nt).todos.length!==1?"s":""}`)},[()=>r(v(Nt).timestamp)]),Z(Kt,re)}),L(Gt),Z(yt,Gt)};mt(Lt,yt=>{t.agent.todos.length===0?yt(fe):yt(oe,!1)})}L(St);var me=H(St,2);{var ee=yt=>{var Gt=vS(),Kt=$(Gt),Nt=H($(Kt)),re=$(Nt);L(Nt),L(Kt);var be=H(Kt,2);hr(be,21,()=>t.agent.children,ue=>ue.id,(ue,Ft)=>{var te=xS(),pe=$(te),Qt=$(pe),Zt=$(Qt),Yt=$(Zt,!0);L(Zt);var he=H(Zt,2),ge=$(he,!0);L(he);var Ie=H(he,2),Me=$(Ie);L(Ie),L(Qt);var R=H(Qt,2),V=$(R,!0);L(R),L(pe),L(te),xt((Q,pt)=>{tt(Yt,Q),tt(ge,pt),tt(Me,`(${v(Ft).toolCalls.length??""} tools, ${v(Ft).todos.length??""} todos)`),tt(V,v(Ft).status)},[()=>l(v(Ft).name),()=>c(v(Ft).name)]),Z(ue,te)}),L(be),L(Gt),xt(()=>tt(re,`(${t.agent.children.length??""})`)),Z(yt,Gt)};mt(me,yt=>{t.agent.children.length>0&&yt(ee)})}L(j),L(A),xt((yt,Gt,Kt,Nt)=>{tt(I,yt),tt(q,Gt),tt(_,t.agent.sessionId),tt(M,t.agent.status),tt(O,Kt),tt(Ht,`(${t.agent.toolCalls.length??""})`),tt(ht,`(${Nt??""} total items, ${t.agent.todos.length??""} updates)`)},[()=>l(t.agent.name),()=>c(t.agent.name),()=>i(t.agent.endTime?t.agent.endTime-t.agent.startTime:Date.now()-t.agent.startTime),()=>t.agent.todos.reduce((yt,Gt)=>yt+Gt.todos.length,0)]),Z(C,A)};mt(b,C=>{t.agent?C(x,!1):C(y)})}Z(e,g),Dr()}Ur(["click"]);var wS=it('<div class="text-yellow-600 dark:text-yellow-400 text-xs"><span></span></div>'),CS=it('<div class="ml-4"><span class="text-cyan-600 dark:text-cyan-400"> </span> <!></div>'),SS=it('<div class="ml-4 text-slate-400 dark:text-slate-500 text-xs"> </div>'),TS=it('<div class="ml-4 text-slate-400 dark:text-slate-500 text-xs"> </div>'),ES=it("<!> <!> <!>",1),AS=it('<div class="mb-1"><button class="inline-flex items-center hover:bg-slate-100 dark:hover:bg-slate-800 rounded px-1 -ml-1 transition-colors"><svg fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg> <span class="text-slate-400 dark:text-slate-500"> </span></button> <!></div>'),MS=it("<span> </span>"),LS=it('<div class="text-center py-12 text-slate-400 dark:text-slate-500"><svg class="w-12 h-12 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg> <p class="text-sm">Select an event or tool to view details</p></div>'),BS=it('<tr class="hover:bg-slate-100 dark:hover:bg-slate-700"><td class="py-2 px-3 font-mono text-xs text-cyan-600 dark:text-cyan-400 w-1/3"> </td><td class="py-2 px-3"><div class="flex items-center gap-2"><span class="text-slate-900 dark:text-slate-100 font-mono text-xs break-all flex-1"> </span> <!></div></td></tr>'),$S=it('<div class="mt-4"><h5 class="text-sm font-semibold text-slate-600 dark:text-slate-400 mb-2">Tool Parameters</h5> <table class="w-full text-sm bg-slate-50 dark:bg-slate-800/50 rounded"><tbody class="divide-y divide-slate-200 dark:divide-slate-700"></tbody></table></div>'),RS=it('<div class="mt-4"><h5 class="text-sm font-semibold text-slate-600 dark:text-slate-400 mb-2">Parameter Keys</h5> <div class="bg-slate-50 dark:bg-slate-800/50 rounded p-3"><span class="text-slate-900 dark:text-slate-100 font-mono text-xs"> </span></div></div>'),OS=it('<div class="mt-4"><div class="flex items-center justify-between mb-2"><h5 class="text-sm font-semibold text-slate-600 dark:text-slate-400">Output</h5> <!></div> <pre class="bg-slate-50 dark:bg-slate-800/50 rounded p-3 text-xs font-mono overflow-x-auto text-slate-900 dark:text-slate-100"> </pre></div>'),NS=it('<div class="mt-4"><div class="flex items-center justify-between mb-2"><h5 class="text-sm font-semibold text-red-600 dark:text-red-400">Error</h5> <!></div> <pre class="bg-red-50 dark:bg-red-900/20 rounded p-3 text-xs font-mono overflow-x-auto text-red-900 dark:text-red-100"> </pre></div>'),IS=it('<table class="w-full text-sm"><tbody class="divide-y divide-slate-200 dark:divide-slate-700"><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400 w-1/3">Exit Code</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Success</td><td class="py-2 px-3"><span> </span></td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Status</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Duration</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Has Output</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Has Error</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Output Size</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Correlation ID</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100 font-mono text-xs break-all"> </td></tr></tbody></table> <!> <!>',1),DS=it('<div class="text-slate-400 dark:text-slate-500 italic py-4 text-center">Waiting for result...</div>'),FS=it('<div class="space-y-6"><div><h4 class="text-sm font-bold text-slate-700 dark:text-slate-300 mb-3 pb-2 border-b border-slate-300 dark:border-slate-600">Tool Invocation</h4> <table class="w-full text-sm"><tbody class="divide-y divide-slate-200 dark:divide-slate-700"><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400 w-1/3">Tool Name</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Operation Type</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Session ID</td><td class="py-2 px-3"><div class="flex items-center gap-2"><span class="text-slate-900 dark:text-slate-100 font-mono text-xs"> </span> <!></div></td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Working Directory</td><td class="py-2 px-3"><div class="flex items-center gap-2"><span class="text-slate-900 dark:text-slate-100 font-mono text-xs break-all"> </span> <!></div></td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Git Branch</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Timestamp</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Parameter Count</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Security Risk</td><td class="py-2 px-3 text-slate-900 dark:text-slate-100"> </td></tr><tr class="hover:bg-slate-50 dark:hover:bg-slate-800"><td class="py-2 px-3 font-semibold text-slate-600 dark:text-slate-400">Correlation ID</td><td class="py-2 px-3"><div class="flex items-center gap-2"><span class="text-slate-900 dark:text-slate-100 font-mono text-xs break-all"> </span> <!></div></td></tr></tbody></table> <!> <!></div> <div><h4 class="text-sm font-bold text-slate-700 dark:text-slate-300 mb-3 pb-2 border-b border-slate-300 dark:border-slate-600">Tool Result</h4> <!></div></div>'),PS=it('<div class="mb-1"><span class="text-cyan-600 dark:text-cyan-400"> </span> <!></div>'),zS=it('<div class="font-mono text-xs"></div>'),WS=it('<div class="flex flex-col h-full bg-white dark:bg-slate-900 border-r border-slate-200 dark:border-slate-700 transition-colors"><div class="px-4 py-3 bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><h3 class="text-sm font-semibold text-slate-900 dark:text-white"> </h3></div> <div class="flex-1 overflow-y-auto p-4"><!></div></div>');function qS(e,t){Ir(t,!0);const r=(E,I=Ol,Y=Ol,q=Ol)=>{var F=Ge(),z=Ee(F);{var D=T=>{var k=wS(),S=$(k);S.textContent="... (max depth 5 reached)",L(k),Z(T,k)},_=T=>{const k=we(()=>s(I())),S=we(()=>h(I())),M=we(()=>v(a).has(Y()));var W=Ge(),N=Ee(W);{var O=G=>{var X=AS(),J=$(X);J.__click=()=>o(Y());var K=$(J),at=H(K,2),lt=$(at,!0);L(at),L(J);var wt=H(J,2);{var _t=ot=>{const Ct=we(()=>l(I()));var zt=ES(),Ht=Ee(zt);hr(Ht,17,()=>v(Ct),di,(Tt,Et)=>{var ht=we(()=>Nl(v(Et),2));let Lt=()=>v(ht)[0],fe=()=>v(ht)[1];var oe=CS(),me=$(oe),ee=$(me);L(me);var yt=H(me,2);r(yt,fe,()=>`${Y()}.${Lt()}`,()=>q()+1),L(oe),xt(()=>tt(ee,`${Lt()??""}:`)),Z(Tt,oe)});var gt=H(Ht,2);{var Mt=Tt=>{var Et=SS(),ht=$(Et);L(Et),xt(()=>tt(ht,`... and ${I().length-i} more items`)),Z(Tt,Et)};mt(gt,Tt=>{Array.isArray(I())&&I().length>i&&Tt(Mt)})}var kt=H(gt,2);{var St=Tt=>{var Et=TS(),ht=$(Et);L(Et),xt(Lt=>tt(ht,`... and ${Lt??""} more properties`),[()=>Object.keys(I()).length-i]),Z(Tt,Et)};mt(kt,Tt=>{!Array.isArray(I())&&typeof I()=="object"&&I()!==null&&Object.keys(I()).length>i&&Tt(St)})}Z(ot,zt)};mt(wt,ot=>{v(M)&&ot(_t)})}L(X),xt(()=>{Ae(K,0,`w-3 h-3 mr-1 transition-transform ${v(M)?"rotate-90":""} text-slate-600 dark:text-slate-400`),tt(lt,v(k)==="array"?"[...]":"{...}")}),Z(G,X)},j=G=>{var X=MS(),J=$(X,!0);L(X),xt((K,at)=>{Ae(X,1,`${K??""} ml-1`),tt(J,at)},[()=>u(v(k)),()=>c(I())]),Z(G,X)};mt(N,G=>{v(S)?G(O):G(j,!1)})}Z(T,W)};mt(z,T=>{q()>=n?T(D):T(_,!1)})}Z(E,F)},i=50,n=5;let a=ae(Bi(new Set));ir(()=>{t.event||t.tool?et(a,new Set(["root","root.data","root.preToolEvent","root.postToolEvent"]),!0):et(a,new Set,!0)});function o(E){const I=new Set(v(a));I.has(E)?I.delete(E):I.add(E),et(a,I,!0)}function s(E){return E===null?"null":Array.isArray(E)?"array":typeof E}function c(E){return E===null?"null":E===void 0?"undefined":typeof E=="string"?E.length>80?`"${E.slice(0,80)}..."`:`"${E}"`:typeof E=="boolean"||typeof E=="number"?String(E):""}function l(E){return Array.isArray(E)?E.slice(0,i).map((I,Y)=>[`[${Y}]`,I]):typeof E=="object"&&E!==null?Object.entries(E).slice(0,i):[]}function h(E){return typeof E=="object"&&E!==null}function u(E){switch(E){case"string":return"text-green-600 dark:text-green-400";case"number":return"text-blue-600 dark:text-blue-400";case"boolean":return"text-purple-600 dark:text-purple-400";case"null":return"text-slate-400 dark:text-slate-500";default:return"text-slate-700 dark:text-slate-300"}}function f(E){return(typeof E=="string"?new Date(E):new Date(E)).toLocaleString()}function d(E){var F,z,D;const I=((F=E.preToolEvent)==null?void 0:F.data)||{},Y=I.tool_parameters||{},q=I.param_keys||[];return{toolName:E.toolName,operationType:I.operation_type||"N/A",sessionId:((z=E.preToolEvent)==null?void 0:z.session_id)||I.session_id||"N/A",workingDirectory:I.working_directory||I.cwd||"N/A",gitBranch:I.git_branch||"N/A",timestamp:(D=E.preToolEvent)!=null&&D.timestamp?f(E.preToolEvent.timestamp):"N/A",parameterCount:Object.keys(Y).length,securityRisk:I.security_risk||"None",correlationId:E.id,toolParameters:Y,paramKeys:Array.isArray(q)?q:[]}}function p(E){var Y;if(!E.postToolEvent)return null;const I=((Y=E.postToolEvent)==null?void 0:Y.data)||{};return{exitCode:I.exit_code??"N/A",success:I.success!==void 0?I.success?"Yes":"No":"N/A",status:I.status||E.status||"N/A",duration:E.duration!==null?`${E.duration}ms`:"N/A",hasOutput:I.output||I.result?"Yes":"No",hasError:I.error||I.is_error?"Yes":"No",outputSize:I.output?String(I.output).length+" chars":"N/A",correlationId:E.id,output:I.output||I.result||null,error:I.error||null}}var g=WS(),b=$(g),y=$(b),x=$(y,!0);L(y),L(b);var C=H(b,2),A=$(C);{var B=E=>{var I=LS();Z(E,I)},w=E=>{var I=Ge(),Y=Ee(I);{var q=z=>{const D=we(()=>d(t.tool)),_=we(()=>p(t.tool));var T=FS(),k=$(T),S=H($(k),2),M=$(S),W=$(M),N=H($(W)),O=$(N,!0);L(N),L(W);var j=H(W),G=H($(j)),X=$(G,!0);L(G),L(j);var J=H(j),K=H($(J)),at=$(K),lt=$(at),wt=$(lt,!0);L(lt);var _t=H(lt,2);Ar(_t,{get text(){return v(D).sessionId},size:"sm"}),L(at),L(K),L(J);var ot=H(J),Ct=H($(ot)),zt=$(Ct),Ht=$(zt),gt=$(Ht,!0);L(Ht);var Mt=H(Ht,2);{var kt=R=>{Ar(R,{get text(){return v(D).workingDirectory},size:"sm"})};mt(Mt,R=>{v(D).workingDirectory!=="N/A"&&R(kt)})}L(zt),L(Ct),L(ot);var St=H(ot),Tt=H($(St)),Et=$(Tt,!0);L(Tt),L(St);var ht=H(St),Lt=H($(ht)),fe=$(Lt,!0);L(Lt),L(ht);var oe=H(ht),me=H($(oe)),ee=$(me,!0);L(me),L(oe);var yt=H(oe),Gt=H($(yt)),Kt=$(Gt,!0);L(Gt),L(yt);var Nt=H(yt),re=H($(Nt)),be=$(re),ue=$(be),Ft=$(ue,!0);L(ue);var te=H(ue,2);Ar(te,{get text(){return v(D).correlationId},size:"sm"}),L(be),L(re),L(Nt),L(M),L(S);var pe=H(S,2);{var Qt=R=>{var V=$S(),Q=H($(V),2),pt=$(Q);hr(pt,21,()=>Object.entries(v(D).toolParameters),di,(le,ie)=>{var ct=we(()=>Nl(v(ie),2));let ut=()=>v(ct)[0],Dt=()=>v(ct)[1];var Te=BS(),ye=$(Te),Ye=$(ye,!0);L(ye);var Tr=H(ye),Fe=$(Tr),Le=$(Fe),Ze=$(Le,!0);L(Le);var Qe=H(Le,2);{let Fr=we(()=>typeof Dt()=="object"?JSON.stringify(Dt(),null,2):String(Dt()));Ar(Qe,{get text(){return v(Fr)},size:"sm"})}L(Fe),L(Tr),L(Te),xt(Fr=>{tt(Ye,ut()),tt(Ze,Fr)},[()=>typeof Dt()=="object"?JSON.stringify(Dt(),null,2):String(Dt())]),Z(le,Te)}),L(pt),L(Q),L(V),Z(R,V)};mt(pe,R=>{Object.keys(v(D).toolParameters).length>0&&R(Qt)})}var Zt=H(pe,2);{var Yt=R=>{var V=RS(),Q=H($(V),2),pt=$(Q),le=$(pt,!0);L(pt),L(Q),L(V),xt(ie=>tt(le,ie),[()=>v(D).paramKeys.join(", ")]),Z(R,V)};mt(Zt,R=>{v(D).paramKeys.length>0&&R(Yt)})}L(k);var he=H(k,2),ge=H($(he),2);{var Ie=R=>{var V=IS(),Q=Ee(V),pt=$(Q),le=$(pt),ie=H($(le)),ct=$(ie,!0);L(ie),L(le);var ut=H(le),Dt=H($(ut)),Te=$(Dt),ye=$(Te,!0);L(Te),L(Dt),L(ut);var Ye=H(ut),Tr=H($(Ye)),Fe=$(Tr,!0);L(Tr),L(Ye);var Le=H(Ye),Ze=H($(Le)),Qe=$(Ze,!0);L(Ze),L(Le);var Fr=H(Le),Vi=H($(Fr)),Xi=$(Vi,!0);L(Vi),L(Fr);var Gr=H(Fr),An=H($(Gr)),Pt=$(An,!0);L(An),L(Gr);var P=H(Gr),nt=H($(P)),At=$(nt,!0);L(nt),L(P);var Be=H(P),Ve=H($(Be)),qe=$(Ve,!0);L(Ve),L(Be),L(pt),L(Q);var Je=H(Q,2);{var ur=dt=>{var ce=OS(),_e=$(ce),je=H($(_e),2);{let zr=we(()=>String(v(_).output));Ar(je,{get text(){return v(zr)},label:"Copy",size:"sm"})}L(_e);var sr=H(_e,2),Pr=$(sr,!0);L(sr),L(ce),xt(zr=>tt(Pr,zr),[()=>String(v(_).output)]),Z(dt,ce)};mt(Je,dt=>{v(_).output&&dt(ur)})}var ii=H(Je,2);{var st=dt=>{var ce=NS(),_e=$(ce),je=H($(_e),2);{let zr=we(()=>String(v(_).error));Ar(je,{get text(){return v(zr)},label:"Copy",size:"sm"})}L(_e);var sr=H(_e,2),Pr=$(sr,!0);L(sr),L(ce),xt(zr=>tt(Pr,zr),[()=>String(v(_).error)]),Z(dt,ce)};mt(ii,dt=>{v(_).error&&dt(st)})}xt(()=>{tt(ct,v(_).exitCode),Ae(Te,1,`px-2 py-1 rounded text-xs font-semibold ${v(_).success==="Yes"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":v(_).success==="No"?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-slate-100 text-slate-800 dark:bg-slate-700 dark:text-slate-300"}`),tt(ye,v(_).success),tt(Fe,v(_).status),tt(Qe,v(_).duration),tt(Xi,v(_).hasOutput),tt(Pt,v(_).hasError),tt(At,v(_).outputSize),tt(qe,v(_).correlationId)}),Z(R,V)},Me=R=>{var V=DS();Z(R,V)};mt(ge,R=>{v(_)?R(Ie):R(Me,!1)})}L(he),L(T),xt(()=>{tt(O,v(D).toolName),tt(X,v(D).operationType),tt(wt,v(D).sessionId),tt(gt,v(D).workingDirectory),tt(Et,v(D).gitBranch),tt(fe,v(D).timestamp),tt(ee,v(D).parameterCount),tt(Kt,v(D).securityRisk),tt(Ft,v(D).correlationId)}),Z(z,T)},F=z=>{var D=Ge(),_=Ee(D);{var T=k=>{var S=zS();hr(S,21,()=>l(t.event),di,(M,W)=>{var N=we(()=>Nl(v(W),2));let O=()=>v(N)[0],j=()=>v(N)[1];var G=PS(),X=$(G),J=$(X);L(X);var K=H(X,2);r(K,j,()=>`root.${O()}`,()=>0),L(G),xt(()=>tt(J,`${O()??""}:`)),Z(M,G)}),L(S),Z(k,S)};mt(_,k=>{t.event&&k(T)},!0)}Z(z,D)};mt(Y,z=>{t.tool?z(q):z(F,!1)},!0)}Z(E,I)};mt(A,E=>{!t.event&&!t.tool?E(B):E(w,!1)})}L(C),L(g),xt(()=>tt(x,t.tool?"Tool Details":"JSON Data Explorer")),Z(e,g),Dr()}Ur(["click"]);function Eg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ul,Cd;function HS(){if(Cd)return Ul;Cd=1;function e(R){return R instanceof Map?R.clear=R.delete=R.set=function(){throw new Error("map is read-only")}:R instanceof Set&&(R.add=R.clear=R.delete=function(){throw new Error("set is read-only")}),Object.freeze(R),Object.getOwnPropertyNames(R).forEach(V=>{const Q=R[V],pt=typeof Q;(pt==="object"||pt==="function")&&!Object.isFrozen(Q)&&e(Q)}),R}class t{constructor(V){V.data===void 0&&(V.data={}),this.data=V.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(R){return R.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(R,...V){const Q=Object.create(null);for(const pt in R)Q[pt]=R[pt];return V.forEach(function(pt){for(const le in pt)Q[le]=pt[le]}),Q}const n="</span>",a=R=>!!R.scope,o=(R,{prefix:V})=>{if(R.startsWith("language:"))return R.replace("language:","language-");if(R.includes(".")){const Q=R.split(".");return[`${V}${Q.shift()}`,...Q.map((pt,le)=>`${pt}${"_".repeat(le+1)}`)].join(" ")}return`${V}${R}`};class s{constructor(V,Q){this.buffer="",this.classPrefix=Q.classPrefix,V.walk(this)}addText(V){this.buffer+=r(V)}openNode(V){if(!a(V))return;const Q=o(V.scope,{prefix:this.classPrefix});this.span(Q)}closeNode(V){a(V)&&(this.buffer+=n)}value(){return this.buffer}span(V){this.buffer+=`<span class="${V}">`}}const c=(R={})=>{const V={children:[]};return Object.assign(V,R),V};class l{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(V){this.top.children.push(V)}openNode(V){const Q=c({scope:V});this.add(Q),this.stack.push(Q)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(V){return this.constructor._walk(V,this.rootNode)}static _walk(V,Q){return typeof Q=="string"?V.addText(Q):Q.children&&(V.openNode(Q),Q.children.forEach(pt=>this._walk(V,pt)),V.closeNode(Q)),V}static _collapse(V){typeof V!="string"&&V.children&&(V.children.every(Q=>typeof Q=="string")?V.children=[V.children.join("")]:V.children.forEach(Q=>{l._collapse(Q)}))}}class h extends l{constructor(V){super(),this.options=V}addText(V){V!==""&&this.add(V)}startScope(V){this.openNode(V)}endScope(){this.closeNode()}__addSublanguage(V,Q){const pt=V.root;Q&&(pt.scope=`language:${Q}`),this.add(pt)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(R){return R?typeof R=="string"?R:R.source:null}function f(R){return g("(?=",R,")")}function d(R){return g("(?:",R,")*")}function p(R){return g("(?:",R,")?")}function g(...R){return R.map(Q=>u(Q)).join("")}function b(R){const V=R[R.length-1];return typeof V=="object"&&V.constructor===Object?(R.splice(R.length-1,1),V):{}}function y(...R){return"("+(b(R).capture?"":"?:")+R.map(pt=>u(pt)).join("|")+")"}function x(R){return new RegExp(R.toString()+"|").exec("").length-1}function C(R,V){const Q=R&&R.exec(V);return Q&&Q.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function B(R,{joinWith:V}){let Q=0;return R.map(pt=>{Q+=1;const le=Q;let ie=u(pt),ct="";for(;ie.length>0;){const ut=A.exec(ie);if(!ut){ct+=ie;break}ct+=ie.substring(0,ut.index),ie=ie.substring(ut.index+ut[0].length),ut[0][0]==="\\"&&ut[1]?ct+="\\"+String(Number(ut[1])+le):(ct+=ut[0],ut[0]==="("&&Q++)}return ct}).map(pt=>`(${pt})`).join(V)}const w=/\b\B/,E="[a-zA-Z]\\w*",I="[a-zA-Z_]\\w*",Y="\\b\\d+(\\.\\d+)?",q="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",D=(R={})=>{const V=/^#![ ]*\//;return R.binary&&(R.begin=g(V,/.*\b/,R.binary,/\b.*/)),i({scope:"meta",begin:V,end:/$/,relevance:0,"on:begin":(Q,pt)=>{Q.index!==0&&pt.ignoreMatch()}},R)},_={begin:"\\\\[\\s\\S]",relevance:0},T={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[_]},k={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[_]},S={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},M=function(R,V,Q={}){const pt=i({scope:"comment",begin:R,end:V,contains:[]},Q);pt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const le=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return pt.contains.push({begin:g(/[ ]+/,"(",le,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),pt},W=M("//","$"),N=M("/\\*","\\*/"),O=M("#","$"),j={scope:"number",begin:Y,relevance:0},G={scope:"number",begin:q,relevance:0},X={scope:"number",begin:F,relevance:0},J={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[_,{begin:/\[/,end:/\]/,relevance:0,contains:[_]}]},K={scope:"title",begin:E,relevance:0},at={scope:"title",begin:I,relevance:0},lt={begin:"\\.\\s*"+I,relevance:0};var _t=Object.freeze({__proto__:null,APOS_STRING_MODE:T,BACKSLASH_ESCAPE:_,BINARY_NUMBER_MODE:X,BINARY_NUMBER_RE:F,COMMENT:M,C_BLOCK_COMMENT_MODE:N,C_LINE_COMMENT_MODE:W,C_NUMBER_MODE:G,C_NUMBER_RE:q,END_SAME_AS_BEGIN:function(R){return Object.assign(R,{"on:begin":(V,Q)=>{Q.data._beginMatch=V[1]},"on:end":(V,Q)=>{Q.data._beginMatch!==V[1]&&Q.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:E,MATCH_NOTHING_RE:w,METHOD_GUARD:lt,NUMBER_MODE:j,NUMBER_RE:Y,PHRASAL_WORDS_MODE:S,QUOTE_STRING_MODE:k,REGEXP_MODE:J,RE_STARTERS_RE:z,SHEBANG:D,TITLE_MODE:K,UNDERSCORE_IDENT_RE:I,UNDERSCORE_TITLE_MODE:at});function ot(R,V){R.input[R.index-1]==="."&&V.ignoreMatch()}function Ct(R,V){R.className!==void 0&&(R.scope=R.className,delete R.className)}function zt(R,V){V&&R.beginKeywords&&(R.begin="\\b("+R.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",R.__beforeBegin=ot,R.keywords=R.keywords||R.beginKeywords,delete R.beginKeywords,R.relevance===void 0&&(R.relevance=0))}function Ht(R,V){Array.isArray(R.illegal)&&(R.illegal=y(...R.illegal))}function gt(R,V){if(R.match){if(R.begin||R.end)throw new Error("begin & end are not supported with match");R.begin=R.match,delete R.match}}function Mt(R,V){R.relevance===void 0&&(R.relevance=1)}const kt=(R,V)=>{if(!R.beforeMatch)return;if(R.starts)throw new Error("beforeMatch cannot be used with starts");const Q=Object.assign({},R);Object.keys(R).forEach(pt=>{delete R[pt]}),R.keywords=Q.keywords,R.begin=g(Q.beforeMatch,f(Q.begin)),R.starts={relevance:0,contains:[Object.assign(Q,{endsParent:!0})]},R.relevance=0,delete Q.beforeMatch},St=["of","and","for","in","not","or","if","then","parent","list","value"],Tt="keyword";function Et(R,V,Q=Tt){const pt=Object.create(null);return typeof R=="string"?le(Q,R.split(" ")):Array.isArray(R)?le(Q,R):Object.keys(R).forEach(function(ie){Object.assign(pt,Et(R[ie],V,ie))}),pt;function le(ie,ct){V&&(ct=ct.map(ut=>ut.toLowerCase())),ct.forEach(function(ut){const Dt=ut.split("|");pt[Dt[0]]=[ie,ht(Dt[0],Dt[1])]})}}function ht(R,V){return V?Number(V):Lt(R)?0:1}function Lt(R){return St.includes(R.toLowerCase())}const fe={},oe=R=>{console.error(R)},me=(R,...V)=>{console.log(`WARN: ${R}`,...V)},ee=(R,V)=>{fe[`${R}/${V}`]||(console.log(`Deprecated as of ${R}. ${V}`),fe[`${R}/${V}`]=!0)},yt=new Error;function Gt(R,V,{key:Q}){let pt=0;const le=R[Q],ie={},ct={};for(let ut=1;ut<=V.length;ut++)ct[ut+pt]=le[ut],ie[ut+pt]=!0,pt+=x(V[ut-1]);R[Q]=ct,R[Q]._emit=ie,R[Q]._multi=!0}function Kt(R){if(Array.isArray(R.begin)){if(R.skip||R.excludeBegin||R.returnBegin)throw oe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yt;if(typeof R.beginScope!="object"||R.beginScope===null)throw oe("beginScope must be object"),yt;Gt(R,R.begin,{key:"beginScope"}),R.begin=B(R.begin,{joinWith:""})}}function Nt(R){if(Array.isArray(R.end)){if(R.skip||R.excludeEnd||R.returnEnd)throw oe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yt;if(typeof R.endScope!="object"||R.endScope===null)throw oe("endScope must be object"),yt;Gt(R,R.end,{key:"endScope"}),R.end=B(R.end,{joinWith:""})}}function re(R){R.scope&&typeof R.scope=="object"&&R.scope!==null&&(R.beginScope=R.scope,delete R.scope)}function be(R){re(R),typeof R.beginScope=="string"&&(R.beginScope={_wrap:R.beginScope}),typeof R.endScope=="string"&&(R.endScope={_wrap:R.endScope}),Kt(R),Nt(R)}function ue(R){function V(ct,ut){return new RegExp(u(ct),"m"+(R.case_insensitive?"i":"")+(R.unicodeRegex?"u":"")+(ut?"g":""))}class Q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ut,Dt){Dt.position=this.position++,this.matchIndexes[this.matchAt]=Dt,this.regexes.push([Dt,ut]),this.matchAt+=x(ut)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ut=this.regexes.map(Dt=>Dt[1]);this.matcherRe=V(B(ut,{joinWith:"|"}),!0),this.lastIndex=0}exec(ut){this.matcherRe.lastIndex=this.lastIndex;const Dt=this.matcherRe.exec(ut);if(!Dt)return null;const Te=Dt.findIndex((Ye,Tr)=>Tr>0&&Ye!==void 0),ye=this.matchIndexes[Te];return Dt.splice(0,Te),Object.assign(Dt,ye)}}class pt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ut){if(this.multiRegexes[ut])return this.multiRegexes[ut];const Dt=new Q;return this.rules.slice(ut).forEach(([Te,ye])=>Dt.addRule(Te,ye)),Dt.compile(),this.multiRegexes[ut]=Dt,Dt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ut,Dt){this.rules.push([ut,Dt]),Dt.type==="begin"&&this.count++}exec(ut){const Dt=this.getMatcher(this.regexIndex);Dt.lastIndex=this.lastIndex;let Te=Dt.exec(ut);if(this.resumingScanAtSamePosition()&&!(Te&&Te.index===this.lastIndex)){const ye=this.getMatcher(0);ye.lastIndex=this.lastIndex+1,Te=ye.exec(ut)}return Te&&(this.regexIndex+=Te.position+1,this.regexIndex===this.count&&this.considerAll()),Te}}function le(ct){const ut=new pt;return ct.contains.forEach(Dt=>ut.addRule(Dt.begin,{rule:Dt,type:"begin"})),ct.terminatorEnd&&ut.addRule(ct.terminatorEnd,{type:"end"}),ct.illegal&&ut.addRule(ct.illegal,{type:"illegal"}),ut}function ie(ct,ut){const Dt=ct;if(ct.isCompiled)return Dt;[Ct,gt,be,kt].forEach(ye=>ye(ct,ut)),R.compilerExtensions.forEach(ye=>ye(ct,ut)),ct.__beforeBegin=null,[zt,Ht,Mt].forEach(ye=>ye(ct,ut)),ct.isCompiled=!0;let Te=null;return typeof ct.keywords=="object"&&ct.keywords.$pattern&&(ct.keywords=Object.assign({},ct.keywords),Te=ct.keywords.$pattern,delete ct.keywords.$pattern),Te=Te||/\w+/,ct.keywords&&(ct.keywords=Et(ct.keywords,R.case_insensitive)),Dt.keywordPatternRe=V(Te,!0),ut&&(ct.begin||(ct.begin=/\B|\b/),Dt.beginRe=V(Dt.begin),!ct.end&&!ct.endsWithParent&&(ct.end=/\B|\b/),ct.end&&(Dt.endRe=V(Dt.end)),Dt.terminatorEnd=u(Dt.end)||"",ct.endsWithParent&&ut.terminatorEnd&&(Dt.terminatorEnd+=(ct.end?"|":"")+ut.terminatorEnd)),ct.illegal&&(Dt.illegalRe=V(ct.illegal)),ct.contains||(ct.contains=[]),ct.contains=[].concat(...ct.contains.map(function(ye){return te(ye==="self"?ct:ye)})),ct.contains.forEach(function(ye){ie(ye,Dt)}),ct.starts&&ie(ct.starts,ut),Dt.matcher=le(Dt),Dt}if(R.compilerExtensions||(R.compilerExtensions=[]),R.contains&&R.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return R.classNameAliases=i(R.classNameAliases||{}),ie(R)}function Ft(R){return R?R.endsWithParent||Ft(R.starts):!1}function te(R){return R.variants&&!R.cachedVariants&&(R.cachedVariants=R.variants.map(function(V){return i(R,{variants:null},V)})),R.cachedVariants?R.cachedVariants:Ft(R)?i(R,{starts:R.starts?i(R.starts):null}):Object.isFrozen(R)?i(R):R}var pe="11.11.1";class Qt extends Error{constructor(V,Q){super(V),this.name="HTMLInjectionError",this.html=Q}}const Zt=r,Yt=i,he=Symbol("nomatch"),ge=7,Ie=function(R){const V=Object.create(null),Q=Object.create(null),pt=[];let le=!0;const ie="Could not find the language '{}', did you forget to load/include a language module?",ct={disableAutodetect:!0,name:"Plain text",contains:[]};let ut={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function Dt(st){return ut.noHighlightRe.test(st)}function Te(st){let dt=st.className+" ";dt+=st.parentNode?st.parentNode.className:"";const ce=ut.languageDetectRe.exec(dt);if(ce){const _e=nt(ce[1]);return _e||(me(ie.replace("{}",ce[1])),me("Falling back to no-highlight mode for this block.",st)),_e?ce[1]:"no-highlight"}return dt.split(/\s+/).find(_e=>Dt(_e)||nt(_e))}function ye(st,dt,ce){let _e="",je="";typeof dt=="object"?(_e=st,ce=dt.ignoreIllegals,je=dt.language):(ee("10.7.0","highlight(lang, code, ...args) has been deprecated."),ee("10.7.0",`Please use highlight(code, options) instead.
|
|
18
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),je=st,_e=dt),ce===void 0&&(ce=!0);const sr={code:_e,language:je};ur("before:highlight",sr);const Pr=sr.result?sr.result:Ye(sr.language,sr.code,ce);return Pr.code=sr.code,ur("after:highlight",Pr),Pr}function Ye(st,dt,ce,_e){const je=Object.create(null);function sr(bt,Wt){return bt.keywords[Wt]}function Pr(){if(!de.keywords){or.addText(Pe);return}let bt=0;de.keywordPatternRe.lastIndex=0;let Wt=de.keywordPatternRe.exec(Pe),xe="";for(;Wt;){xe+=Pe.substring(bt,Wt.index);const De=ai.case_insensitive?Wt[0].toLowerCase():Wt[0],dr=sr(de,De);if(dr){const[yi,Ev]=dr;if(or.addText(xe),xe="",je[De]=(je[De]||0)+1,je[De]<=ge&&(ws+=Ev),yi.startsWith("_"))xe+=Wt[0];else{const Av=ai.classNameAliases[yi]||yi;ni(Wt[0],Av)}}else xe+=Wt[0];bt=de.keywordPatternRe.lastIndex,Wt=de.keywordPatternRe.exec(Pe)}xe+=Pe.substring(bt),or.addText(xe)}function zr(){if(Pe==="")return;let bt=null;if(typeof de.subLanguage=="string"){if(!V[de.subLanguage]){or.addText(Pe);return}bt=Ye(de.subLanguage,Pe,!0,Wu[de.subLanguage]),Wu[de.subLanguage]=bt._top}else bt=Fe(Pe,de.subLanguage.length?de.subLanguage:null);de.relevance>0&&(ws+=bt.relevance),or.__addSublanguage(bt._emitter,bt.language)}function $r(){de.subLanguage!=null?zr():Pr(),Pe=""}function ni(bt,Wt){bt!==""&&(or.startScope(Wt),or.addText(bt),or.endScope())}function Du(bt,Wt){let xe=1;const De=Wt.length-1;for(;xe<=De;){if(!bt._emit[xe]){xe++;continue}const dr=ai.classNameAliases[bt[xe]]||bt[xe],yi=Wt[xe];dr?ni(yi,dr):(Pe=yi,Pr(),Pe=""),xe++}}function Fu(bt,Wt){return bt.scope&&typeof bt.scope=="string"&&or.openNode(ai.classNameAliases[bt.scope]||bt.scope),bt.beginScope&&(bt.beginScope._wrap?(ni(Pe,ai.classNameAliases[bt.beginScope._wrap]||bt.beginScope._wrap),Pe=""):bt.beginScope._multi&&(Du(bt.beginScope,Wt),Pe="")),de=Object.create(bt,{parent:{value:de}}),de}function Pu(bt,Wt,xe){let De=C(bt.endRe,xe);if(De){if(bt["on:end"]){const dr=new t(bt);bt["on:end"](Wt,dr),dr.isMatchIgnored&&(De=!1)}if(De){for(;bt.endsParent&&bt.parent;)bt=bt.parent;return bt}}if(bt.endsWithParent)return Pu(bt.parent,Wt,xe)}function kv(bt){return de.matcher.regexIndex===0?(Pe+=bt[0],1):($l=!0,0)}function wv(bt){const Wt=bt[0],xe=bt.rule,De=new t(xe),dr=[xe.__beforeBegin,xe["on:begin"]];for(const yi of dr)if(yi&&(yi(bt,De),De.isMatchIgnored))return kv(Wt);return xe.skip?Pe+=Wt:(xe.excludeBegin&&(Pe+=Wt),$r(),!xe.returnBegin&&!xe.excludeBegin&&(Pe=Wt)),Fu(xe,bt),xe.returnBegin?0:Wt.length}function Cv(bt){const Wt=bt[0],xe=dt.substring(bt.index),De=Pu(de,bt,xe);if(!De)return he;const dr=de;de.endScope&&de.endScope._wrap?($r(),ni(Wt,de.endScope._wrap)):de.endScope&&de.endScope._multi?($r(),Du(de.endScope,bt)):dr.skip?Pe+=Wt:(dr.returnEnd||dr.excludeEnd||(Pe+=Wt),$r(),dr.excludeEnd&&(Pe=Wt));do de.scope&&or.closeNode(),!de.skip&&!de.subLanguage&&(ws+=de.relevance),de=de.parent;while(de!==De.parent);return De.starts&&Fu(De.starts,bt),dr.returnEnd?0:Wt.length}function Sv(){const bt=[];for(let Wt=de;Wt!==ai;Wt=Wt.parent)Wt.scope&&bt.unshift(Wt.scope);bt.forEach(Wt=>or.openNode(Wt))}let ks={};function zu(bt,Wt){const xe=Wt&&Wt[0];if(Pe+=bt,xe==null)return $r(),0;if(ks.type==="begin"&&Wt.type==="end"&&ks.index===Wt.index&&xe===""){if(Pe+=dt.slice(Wt.index,Wt.index+1),!le){const De=new Error(`0 width match regex (${st})`);throw De.languageName=st,De.badRule=ks.rule,De}return 1}if(ks=Wt,Wt.type==="begin")return wv(Wt);if(Wt.type==="illegal"&&!ce){const De=new Error('Illegal lexeme "'+xe+'" for mode "'+(de.scope||"<unnamed>")+'"');throw De.mode=de,De}else if(Wt.type==="end"){const De=Cv(Wt);if(De!==he)return De}if(Wt.type==="illegal"&&xe==="")return Pe+=`
|
|
19
|
+
`,1;if(Bl>1e5&&Bl>Wt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=xe,xe.length}const ai=nt(st);if(!ai)throw oe(ie.replace("{}",st)),new Error('Unknown language: "'+st+'"');const Tv=ue(ai);let Ll="",de=_e||Tv;const Wu={},or=new ut.__emitter(ut);Sv();let Pe="",ws=0,Zi=0,Bl=0,$l=!1;try{if(ai.__emitTokens)ai.__emitTokens(dt,or);else{for(de.matcher.considerAll();;){Bl++,$l?$l=!1:de.matcher.considerAll(),de.matcher.lastIndex=Zi;const bt=de.matcher.exec(dt);if(!bt)break;const Wt=dt.substring(Zi,bt.index),xe=zu(Wt,bt);Zi=bt.index+xe}zu(dt.substring(Zi))}return or.finalize(),Ll=or.toHTML(),{language:st,value:Ll,relevance:ws,illegal:!1,_emitter:or,_top:de}}catch(bt){if(bt.message&&bt.message.includes("Illegal"))return{language:st,value:Zt(dt),illegal:!0,relevance:0,_illegalBy:{message:bt.message,index:Zi,context:dt.slice(Zi-100,Zi+100),mode:bt.mode,resultSoFar:Ll},_emitter:or};if(le)return{language:st,value:Zt(dt),illegal:!1,relevance:0,errorRaised:bt,_emitter:or,_top:de};throw bt}}function Tr(st){const dt={value:Zt(st),illegal:!1,relevance:0,_top:ct,_emitter:new ut.__emitter(ut)};return dt._emitter.addText(st),dt}function Fe(st,dt){dt=dt||ut.languages||Object.keys(V);const ce=Tr(st),_e=dt.filter(nt).filter(Be).map($r=>Ye($r,st,!1));_e.unshift(ce);const je=_e.sort(($r,ni)=>{if($r.relevance!==ni.relevance)return ni.relevance-$r.relevance;if($r.language&&ni.language){if(nt($r.language).supersetOf===ni.language)return 1;if(nt(ni.language).supersetOf===$r.language)return-1}return 0}),[sr,Pr]=je,zr=sr;return zr.secondBest=Pr,zr}function Le(st,dt,ce){const _e=dt&&Q[dt]||ce;st.classList.add("hljs"),st.classList.add(`language-${_e}`)}function Ze(st){let dt=null;const ce=Te(st);if(Dt(ce))return;if(ur("before:highlightElement",{el:st,language:ce}),st.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",st);return}if(st.children.length>0&&(ut.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(st)),ut.throwUnescapedHTML))throw new Qt("One of your code blocks includes unescaped HTML.",st.innerHTML);dt=st;const _e=dt.textContent,je=ce?ye(_e,{language:ce,ignoreIllegals:!0}):Fe(_e);st.innerHTML=je.value,st.dataset.highlighted="yes",Le(st,ce,je.language),st.result={language:je.language,re:je.relevance,relevance:je.relevance},je.secondBest&&(st.secondBest={language:je.secondBest.language,relevance:je.secondBest.relevance}),ur("after:highlightElement",{el:st,result:je,text:_e})}function Qe(st){ut=Yt(ut,st)}const Fr=()=>{Gr(),ee("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Vi(){Gr(),ee("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Xi=!1;function Gr(){function st(){Gr()}if(document.readyState==="loading"){Xi||window.addEventListener("DOMContentLoaded",st,!1),Xi=!0;return}document.querySelectorAll(ut.cssSelector).forEach(Ze)}function An(st,dt){let ce=null;try{ce=dt(R)}catch(_e){if(oe("Language definition for '{}' could not be registered.".replace("{}",st)),le)oe(_e);else throw _e;ce=ct}ce.name||(ce.name=st),V[st]=ce,ce.rawDefinition=dt.bind(null,R),ce.aliases&&At(ce.aliases,{languageName:st})}function Pt(st){delete V[st];for(const dt of Object.keys(Q))Q[dt]===st&&delete Q[dt]}function P(){return Object.keys(V)}function nt(st){return st=(st||"").toLowerCase(),V[st]||V[Q[st]]}function At(st,{languageName:dt}){typeof st=="string"&&(st=[st]),st.forEach(ce=>{Q[ce.toLowerCase()]=dt})}function Be(st){const dt=nt(st);return dt&&!dt.disableAutodetect}function Ve(st){st["before:highlightBlock"]&&!st["before:highlightElement"]&&(st["before:highlightElement"]=dt=>{st["before:highlightBlock"](Object.assign({block:dt.el},dt))}),st["after:highlightBlock"]&&!st["after:highlightElement"]&&(st["after:highlightElement"]=dt=>{st["after:highlightBlock"](Object.assign({block:dt.el},dt))})}function qe(st){Ve(st),pt.push(st)}function Je(st){const dt=pt.indexOf(st);dt!==-1&&pt.splice(dt,1)}function ur(st,dt){const ce=st;pt.forEach(function(_e){_e[ce]&&_e[ce](dt)})}function ii(st){return ee("10.7.0","highlightBlock will be removed entirely in v12.0"),ee("10.7.0","Please use highlightElement now."),Ze(st)}Object.assign(R,{highlight:ye,highlightAuto:Fe,highlightAll:Gr,highlightElement:Ze,highlightBlock:ii,configure:Qe,initHighlighting:Fr,initHighlightingOnLoad:Vi,registerLanguage:An,unregisterLanguage:Pt,listLanguages:P,getLanguage:nt,registerAliases:At,autoDetection:Be,inherit:Yt,addPlugin:qe,removePlugin:Je}),R.debugMode=function(){le=!1},R.safeMode=function(){le=!0},R.versionString=pe,R.regex={concat:g,lookahead:f,either:y,optional:p,anyNumberOfTimes:d};for(const st in _t)typeof _t[st]=="object"&&e(_t[st]);return Object.assign(R,_t),R},Me=Ie({});return Me.newInstance=()=>Ie({}),Ul=Me,Me.HighlightJS=Me,Me.default=Me,Ul}var jS=HS();const Rn=Eg(jS);var US=it("<pre><code><!></code></pre>");function Ag(e,t){const r=Vn(t,["children","$$slots","$$events","$$legacy"]),i=Vn(r,["code","highlighted","languageName","langtag"]);let n=We(t,"code",8),a=We(t,"highlighted",8),o=We(t,"languageName",8,"plaintext"),s=We(t,"langtag",8,!1);var c=US();w_(c,()=>({"data-language":o(),...i,[La]:{langtag:s()}}),void 0,void 0,void 0,"svelte-167dipq");var l=$(c);Ae(l,1,"",null,{},{hljs:!0});var h=$(l);{var u=d=>{var p=Ge(),g=Ee(p);kh(g,a),Z(d,p)},f=d=>{var p=$v();xt(()=>tt(p,n())),Z(d,p)};mt(h,d=>{a()?d(u):d(f,!1)})}L(l),L(c),Z(e,c)}function GS(e,t){const r=Vn(t,["children","$$slots","$$events","$$legacy"]),i=Vn(r,["language","code","langtag"]);Ir(t,!1);let n=We(t,"language",8),a=We(t,"code",8),o=We(t,"langtag",8,!1);const s=mp();let c=_h("");bp(()=>{v(c)&&s("highlight",{highlighted:v(c)})}),yp(()=>(js(n()),js(a())),()=>{Rn.registerLanguage(n().name,n().register),et(c,Rn.highlight(a(),{language:n().name}).value)}),xp(),wp();var l=Ge(),h=Ee(l);kp(h,t,"default",{get highlighted(){return v(c)}},u=>{Ag(u,_p(()=>i,{get languageName(){return js(n()),gp(()=>n().name)},get langtag(){return o()},get highlighted(){return v(c)},get code(){return a()}}))}),Z(e,l),Dr()}function Mg(e){const t=e.regex,r=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(r,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const Sd="[A-Za-z$_][0-9A-Za-z$_]*",YS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],VS=["true","false","null","undefined","NaN","Infinity"],Lg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Bg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$g=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],XS=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZS=[].concat($g,Lg,Bg);function Rg(e){const t=e.regex,r=(M,{after:W})=>{const N="</"+M[0].slice(1);return M.input.indexOf(N,W)!==-1},i=Sd,n={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,W)=>{const N=M[0].length+M.index,O=M.input[N];if(O==="<"||O===","){W.ignoreMatch();return}O===">"&&(r(M,{after:N})||W.ignoreMatch());let j;const G=M.input.substring(N);if(j=G.match(/^\s*=/)){W.ignoreMatch();return}if((j=G.match(/^\s+extends\s+/))&&j.index===0){W.ignoreMatch();return}}},s={$pattern:Sd,keyword:YS,literal:VS,built_in:ZS,"variable.language":XS},c="[0-9](_?[0-9])*",l=`\\.(${c})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${h})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${h})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,g,b,{match:/\$\d+/},u];f.contains=C.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(C)});const A=[].concat(x,f.contains),B=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(A)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:B},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Lg,...Bg]}},Y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function z(M){return t.concat("(?!",M.join("|"),")")}const D={match:t.concat(/\b/,z([...$g,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,g,b,x,{match:/\$\d+/},u,I,{scope:"attr",match:i+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},D,F,E,T,{match:/\$[(.]/}]}}const KS=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),QS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],JS=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],tT=[...QS,...JS],eT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),iT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),nT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Og(e){const t=e.regex,r=KS(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",s=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,i,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rT.join("|")+")"},{begin:":(:)?("+iT.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+nT.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:n,attribute:eT.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tT.join("|")+")\\b"}]}}function aT(e,t){const r=Vn(t,["children","$$slots","$$events","$$legacy"]),i=Vn(r,["code","langtag"]);Ir(t,!1);const n=_h();let a=We(t,"code",8),o=We(t,"langtag",8,!1);const s=mp();Rn.registerLanguage("xml",Mg),Rn.registerLanguage("javascript",Rg),Rn.registerLanguage("css",Og),bp(()=>{v(n)&&s("highlight",{highlighted:v(n)})}),yp(()=>js(a()),()=>{et(n,Rn.highlightAuto(a()).value)}),xp(),wp();var c=Ge(),l=Ee(c);kp(l,t,"default",{get highlighted(){return v(n)}},h=>{Ag(h,_p(()=>i,{languageName:"svelte",get langtag(){return o()},get highlighted(){return v(n)},get code(){return a()}}))}),Z(e,c),Dr()}function sT(e){const t=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},h={begin:/\{\{/,relevance:0},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,h,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,h,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,h,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,h,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",d=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,p=`\\b|${i.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${d}))[eE][+-]?(${f})[jJ]?(?=${p})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${f})[jJ](?=${p})`}]},b={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",c,g,u,e.HASH_COMMENT_MODE]}]};return l.contains=[u,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,u]}]}}const oT={name:"python",register:sT},ko="[A-Za-z$_][0-9A-Za-z$_]*",Ng=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ig=["true","false","null","undefined","NaN","Infinity"],Dg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Fg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Pg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wg=[].concat(Pg,Dg,Fg);function lT(e){const t=e.regex,r=(M,{after:W})=>{const N="</"+M[0].slice(1);return M.input.indexOf(N,W)!==-1},i=ko,n={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,W)=>{const N=M[0].length+M.index,O=M.input[N];if(O==="<"||O===","){W.ignoreMatch();return}O===">"&&(r(M,{after:N})||W.ignoreMatch());let j;const G=M.input.substring(N);if(j=G.match(/^\s*=/)){W.ignoreMatch();return}if((j=G.match(/^\s+extends\s+/))&&j.index===0){W.ignoreMatch();return}}},s={$pattern:ko,keyword:Ng,literal:Ig,built_in:Wg,"variable.language":zg},c="[0-9](_?[0-9])*",l=`\\.(${c})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${h})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${h})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,g,b,{match:/\$\d+/},u];f.contains=C.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(C)});const A=[].concat(x,f.contains),B=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(A)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:B},E={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Dg,...Fg]}},Y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function z(M){return t.concat("(?!",M.join("|"),")")}const D={match:t.concat(/\b/,z([...Pg,"super","import"].map(M=>`${M}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,g,b,x,{match:/\$\d+/},u,I,{scope:"attr",match:i+t.lookahead(":"),relevance:0},S,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},D,F,E,T,{match:/\$[(.]/}]}}function cT(e){const t=e.regex,r=lT(e),i=ko,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[r.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:ko,keyword:Ng.concat(c),literal:Ig,built_in:Wg.concat(n),"variable.language":zg},h={className:"meta",begin:"@"+i},u=(g,b,y)=>{const x=g.contains.findIndex(C=>C.label===b);if(x===-1)throw new Error("can not find mode to replace");g.contains.splice(x,1,y)};Object.assign(r.keywords,l),r.exports.PARAMS_CONTAINS.push(h);const f=r.contains.find(g=>g.scope==="attr"),d=Object.assign({},f,{match:t.concat(i,t.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,f,d]),r.contains=r.contains.concat([h,a,o,d]),u(r,"shebang",e.SHEBANG()),u(r,"use_strict",s);const p=r.contains.find(g=>g.label==="func.def");return p.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const Td={name:"typescript",register:cT},Ed={name:"javascript",register:Rg};function hT(e){const t=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},n={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(l,{contains:[]}),f=e.inherit(h,{contains:[]});l.contains.push(f),h.contains.push(u);let d=[r,c];return[l,h,u,f].forEach(y=>{y.contains=y.contains.concat(d)}),d=d.concat(l,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:d},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:d}]}]},r,a,l,h,{className:"quote",begin:"^>\\s+",contains:d,end:"$"},n,i,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}const Ad={name:"markdown",register:hT};function uT(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],n={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,r,e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const dT={name:"json",register:uT},Md={name:"xml",register:Mg},fT={name:"css",register:Og};function pT(e){const t=e.regex,r={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const n={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,n]};n.contains.push(s);const c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},h={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],b=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],B=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:b,built_in:[...x,...C,"set","shopt",...A,...B]},contains:[d,e.SHEBANG(),p,u,a,o,y,s,c,l,h,r]}}const Ld={name:"bash",register:pT};function gT(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},n={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,n]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},b=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,g,a,o],y=[...b];return y.pop(),y.push(s),d.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}const Bd={name:"yaml",register:gT},mT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),bT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],yT=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],xT=[...bT,...yT],vT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_T=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),kT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function CT(e){const t=mT(e),r=kT,i=_T,n="@[a-z-]+",a="and or not only",s={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+xT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wT.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,s,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:vT.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}const $d={name:"scss",register:CT};function ST(e){const t=e.regex,r=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},n={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],d=h,p=[...l,...c].filter(B=>!h.includes(B)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},b={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...d),/\s*\(/),relevance:0,keywords:{built_in:d}};function x(B){return t.concat(/\b/,t.either(...B.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:x(f),relevance:0};function A(B,{exceptions:w,when:E}={}){const I=E;return w=w||[],B.map(Y=>Y.match(/\|\d+$/)||w.includes(Y)?Y:I(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(p,{when:B=>B.length<3}),literal:a,type:s,built_in:u},contains:[{scope:"type",match:x(o)},C,y,g,i,n,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,b]}}const TT={name:"sql",register:ST};function Fh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var kn=Fh();function qg(e){kn=e}var Wa={exec:()=>null};function Ce(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(vr.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,t)};return i}var ET=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),vr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},AT=/^(?:[ \t]*(?:\n|$))+/,MT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,BT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ph=/(?:[*+-]|\d{1,9}[.)])/,Hg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jg=Ce(Hg).replace(/bull/g,Ph).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$T=Ce(Hg).replace(/bull/g,Ph).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,RT=/^[^\n]+/,Wh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,OT=Ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),NT=Ce(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ph).getRegex(),sl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",qh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,IT=Ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",qh).replace("tag",sl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ug=Ce(zh).replace("hr",fs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sl).getRegex(),DT=Ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ug).getRegex(),Hh={blockquote:DT,code:MT,def:OT,fences:LT,heading:BT,hr:fs,html:IT,lheading:jg,list:NT,newline:AT,paragraph:Ug,table:Wa,text:RT},Rd=Ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sl).getRegex(),FT={...Hh,lheading:$T,table:Rd,paragraph:Ce(zh).replace("hr",fs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Rd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sl).getRegex()},PT={...Hh,html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ce(zh).replace("hr",fs).replace("heading",` *#{1,6} *[^
|
|
20
|
+
]`).replace("lheading",jg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,WT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gg=/^( {2,}|\\)\n(?!\s*$)/,qT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ol=/[\p{P}\p{S}]/u,jh=/[\s\p{P}\p{S}]/u,Yg=/[^\s\p{P}\p{S}]/u,HT=Ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jh).getRegex(),Vg=/(?!~)[\p{P}\p{S}]/u,jT=/(?!~)[\s\p{P}\p{S}]/u,UT=/(?:[^\s\p{P}\p{S}]|~)/u,GT=Ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ET?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Xg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,YT=Ce(Xg,"u").replace(/punct/g,ol).getRegex(),VT=Ce(Xg,"u").replace(/punct/g,Vg).getRegex(),Zg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",XT=Ce(Zg,"gu").replace(/notPunctSpace/g,Yg).replace(/punctSpace/g,jh).replace(/punct/g,ol).getRegex(),ZT=Ce(Zg,"gu").replace(/notPunctSpace/g,UT).replace(/punctSpace/g,jT).replace(/punct/g,Vg).getRegex(),KT=Ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yg).replace(/punctSpace/g,jh).replace(/punct/g,ol).getRegex(),QT=Ce(/\\(punct)/,"gu").replace(/punct/g,ol).getRegex(),JT=Ce(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tE=Ce(qh).replace("(?:-->|$)","-->").getRegex(),eE=Ce("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tE).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,rE=Ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",wo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Kg=Ce(/^!?\[(label)\]\[(ref)\]/).replace("label",wo).replace("ref",Wh).getRegex(),Qg=Ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wh).getRegex(),iE=Ce("reflink|nolink(?!\\()","g").replace("reflink",Kg).replace("nolink",Qg).getRegex(),Od=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Uh={_backpedal:Wa,anyPunctuation:QT,autolink:JT,blockSkip:GT,br:Gg,code:WT,del:Wa,emStrongLDelim:YT,emStrongRDelimAst:XT,emStrongRDelimUnd:KT,escape:zT,link:rE,nolink:Qg,punctuation:HT,reflink:Kg,reflinkSearch:iE,tag:eE,text:qT,url:Wa},nE={...Uh,link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",wo).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wo).getRegex()},Cc={...Uh,emStrongRDelimAst:ZT,emStrongLDelim:VT,url:Ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Od).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ce(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Od).getRegex()},aE={...Cc,br:Ce(Gg).replace("{2,}","*").getRegex(),text:Ce(Cc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bs={normal:Hh,gfm:FT,pedantic:PT},ga={normal:Uh,gfm:Cc,breaks:aE,pedantic:nE},sE={"&":"&","<":"<",">":">",'"':""","'":"'"},Nd=e=>sE[e];function _i(e,t){if(t){if(vr.escapeTest.test(e))return e.replace(vr.escapeReplace,Nd)}else if(vr.escapeTestNoEncode.test(e))return e.replace(vr.escapeReplaceNoEncode,Nd);return e}function Id(e){try{e=encodeURI(e).replace(vr.percentDecode,"%")}catch{return null}return e}function Dd(e,t){var a;let r=e.replace(vr.findPipe,(o,s,c)=>{let l=!1,h=s;for(;--h>=0&&c[h]==="\\";)l=!l;return l?"|":" |"}),i=r.split(vr.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(vr.slashPipe,"|");return i}function ma(e,t,r){let i=e.length;if(i===0)return"";let n=0;for(;n<i&&e.charAt(i-n-1)===t;)n++;return e.slice(0,i-n)}function oE(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function Fd(e,t,r,i,n){let a=t.href,o=t.title||null,s=e[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,c}function lE(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let n=i[1];return t.split(`
|
|
21
|
+
`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=n.length?a.slice(n.length):a}).join(`
|
|
22
|
+
`)}var Co=class{constructor(t){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=t||kn}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:ma(i,`
|
|
23
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],n=lE(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:n}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let n=ma(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:ma(r[0],`
|
|
24
|
+
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=ma(r[0],`
|
|
25
|
+
`).split(`
|
|
26
|
+
`),n="",a="",o=[];for(;i.length>0;){let s=!1,c=[],l;for(l=0;l<i.length;l++)if(this.rules.other.blockquoteStart.test(i[l]))c.push(i[l]),s=!0;else if(!s)c.push(i[l]);else break;i=i.slice(l);let h=c.join(`
|
|
27
|
+
`),u=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
28
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
29
|
+
${h}`:h,a=a?`${a}
|
|
30
|
+
${u}`:u;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=f,i.length===0)break;let d=o.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){let p=d,g=p.raw+`
|
|
31
|
+
`+i.join(`
|
|
32
|
+
`),b=this.blockquote(g);o[o.length-1]=b,n=n.substring(0,n.length-p.raw.length)+b.raw,a=a.substring(0,a.length-p.text.length)+b.text;break}else if((d==null?void 0:d.type)==="list"){let p=d,g=p.raw+`
|
|
33
|
+
`+i.join(`
|
|
34
|
+
`),b=this.list(g);o[o.length-1]=b,n=n.substring(0,n.length-d.raw.length)+b.raw,a=a.substring(0,a.length-p.raw.length)+b.raw,i=g.substring(o.at(-1).raw.length).split(`
|
|
35
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:a}}}list(t){var i,n;let r=this.rules.block.list.exec(t);if(r){let a=r[1].trim(),o=a.length>1,s={type:"list",raw:"",ordered:o,start:o?+a.slice(0,-1):"",loose:!1,items:[]};a=o?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=o?a:"[*+-]");let c=this.rules.other.listItemRegex(a),l=!1;for(;t;){let u=!1,f="",d="";if(!(r=c.exec(t))||this.rules.block.hr.test(t))break;f=r[0],t=t.substring(f.length);let p=r[2].split(`
|
|
36
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),g=t.split(`
|
|
37
|
+
`,1)[0],b=!p.trim(),y=0;if(this.options.pedantic?(y=2,d=p.trimStart()):b?y=r[1].length+1:(y=r[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,d=p.slice(y),y+=r[1].length),b&&this.rules.other.blankLine.test(g)&&(f+=g+`
|
|
38
|
+
`,t=t.substring(g.length+1),u=!0),!u){let x=this.rules.other.nextBulletRegex(y),C=this.rules.other.hrRegex(y),A=this.rules.other.fencesBeginRegex(y),B=this.rules.other.headingBeginRegex(y),w=this.rules.other.htmlBeginRegex(y);for(;t;){let E=t.split(`
|
|
39
|
+
`,1)[0],I;if(g=E,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),I=g):I=g.replace(this.rules.other.tabCharGlobal," "),A.test(g)||B.test(g)||w.test(g)||x.test(g)||C.test(g))break;if(I.search(this.rules.other.nonSpaceChar)>=y||!g.trim())d+=`
|
|
40
|
+
`+I.slice(y);else{if(b||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(p)||B.test(p)||C.test(p))break;d+=`
|
|
41
|
+
`+g}!b&&!g.trim()&&(b=!0),f+=E+`
|
|
42
|
+
`,t=t.substring(E.length+1),p=I.slice(y)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(l=!0)),s.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),s.raw+=f}let h=s.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u of s.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((i=u.tokens[0])==null?void 0:i.type)==="text"||((n=u.tokens[0])==null?void 0:n.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(u.raw);if(f){let d={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};u.checked=d.checked,s.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=d.raw+u.tokens[0].raw,u.tokens[0].text=d.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(d)):u.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):u.tokens.unshift(d)}}if(!s.loose){let f=u.tokens.filter(p=>p.type==="space"),d=f.length>0&&f.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=d}}if(s.loose)for(let u of s.items){u.loose=!0;for(let f of u.tokens)f.type==="text"&&(f.type="paragraph")}return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:n,title:a}}}table(t){var s;let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=Dd(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=r[3])!=null&&s.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
43
|
+
`):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===n.length){for(let c of n)this.rules.other.tableAlignRight.test(c)?o.align.push("right"):this.rules.other.tableAlignCenter.test(c)?o.align.push("center"):this.rules.other.tableAlignLeft.test(c)?o.align.push("left"):o.align.push(null);for(let c=0;c<i.length;c++)o.header.push({text:i[c],tokens:this.lexer.inline(i[c]),header:!0,align:o.align[c]});for(let c of a)o.rows.push(Dd(c,o.header.length).map((l,h)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[h]})));return o}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
44
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=ma(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=oE(r[2],"()");if(o===-2)return;if(o>-1){let s=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,s).trim(),r[3]=""}}let n=r[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],a=o[3])}else a=r[3]?r[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),Fd(r,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[n.toLowerCase()];if(!a){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return Fd(i,a,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||n[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!i||this.rules.inline.punctuation.exec(i))){let a=[...n[0]].length-1,o,s,c=a,l=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+a);(n=h.exec(r))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){c+=s;continue}else if((n[5]||n[6])&&a%3&&!((a+s)%3)){l+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+l);let u=[...n[0]][0].length,f=t.slice(0,a+n.index+u+s);if(Math.min(a,s)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,n;return r[2]==="@"?(i=r[1],n="mailto:"+i):(i=r[1],n=i),{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i;let r;if(r=this.rules.inline.url.exec(t)){let n,a;if(r[2]==="@")n=r[0],a="mailto:"+n;else{let o;do o=r[0],r[0]=((i=this.rules.inline._backpedal.exec(r[0]))==null?void 0:i[0])??"";while(o!==r[0]);n=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Vr=class Sc{constructor(t){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"inlineQueue");jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||kn,this.options.tokenizer=this.options.tokenizer||new Co,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:vr,block:Bs.normal,inline:ga.normal};this.options.pedantic?(r.block=Bs.pedantic,r.inline=ga.pedantic):this.options.gfm&&(r.block=Bs.gfm,this.options.breaks?r.inline=ga.breaks:r.inline=ga.gfm),this.tokenizer.rules=r}static get rules(){return{block:Bs,inline:ga}}static lex(t,r){return new Sc(r).lex(t)}static lexInline(t,r){return new Sc(r).inlineTokens(t)}lex(t){t=t.replace(vr.carriageReturn,`
|
|
45
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){var n,a,o;for(this.options.pedantic&&(t=t.replace(vr.tabCharGlobal," ").replace(vr.spaceLine,""));t;){let s;if((a=(n=this.options.extensions)==null?void 0:n.block)!=null&&a.some(l=>(s=l.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let l=r.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
|
|
46
|
+
`:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(`
|
|
47
|
+
`)?"":`
|
|
48
|
+
`)+s.raw,l.text+=`
|
|
49
|
+
`+s.text,this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(`
|
|
50
|
+
`)?"":`
|
|
51
|
+
`)+s.raw,l.text+=`
|
|
52
|
+
`+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let c=t;if((o=this.options.extensions)!=null&&o.startBlock){let l=1/0,h=t.slice(1),u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=t.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(c))){let l=r.at(-1);i&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
53
|
+
`)?"":`
|
|
54
|
+
`)+s.raw,l.text+=`
|
|
55
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s),i=c.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(`
|
|
56
|
+
`)?"":`
|
|
57
|
+
`)+s.raw,l.text+=`
|
|
58
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var c,l,h,u,f;let i=t,n=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)a=n[2]?n[2].length:0,i=i.slice(0,n.index+a)+"["+"a".repeat(n[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((l=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:l.call({lexer:this},i))??i;let o=!1,s="";for(;t;){o||(s=""),o=!1;let d;if((u=(h=this.options.extensions)==null?void 0:h.inline)!=null&&u.some(g=>(d=g.call({lexer:this},t,r))?(t=t.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let g=r.at(-1);d.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(t,i,s)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),r.push(d);continue}let p=t;if((f=this.options.extensions)!=null&&f.startInline){let g=1/0,b=t.slice(1),y;this.options.extensions.startInline.forEach(x=>{y=x.call({lexer:this},b),typeof y=="number"&&y>=0&&(g=Math.min(g,y))}),g<1/0&&g>=0&&(p=t.substring(0,g+1))}if(d=this.tokenizer.inlineText(p)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(s=d.raw.slice(-1)),o=!0;let g=r.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):r.push(d);continue}if(t){let g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return r}},So=class{constructor(t){jt(this,"options");jt(this,"parser");this.options=t||kn}space(t){return""}code({text:t,lang:r,escaped:i}){var o;let n=(o=(r||"").match(vr.notSpaceStart))==null?void 0:o[0],a=t.replace(vr.endingNewline,"")+`
|
|
59
|
+
`;return n?'<pre><code class="language-'+_i(n)+'">'+(i?a:_i(a,!0))+`</code></pre>
|
|
60
|
+
`:"<pre><code>"+(i?a:_i(a,!0))+`</code></pre>
|
|
61
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
62
|
+
${this.parser.parse(t)}</blockquote>
|
|
63
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
64
|
+
`}hr(t){return`<hr>
|
|
65
|
+
`}list(t){let r=t.ordered,i=t.start,n="";for(let s=0;s<t.items.length;s++){let c=t.items[s];n+=this.listitem(c)}let a=r?"ol":"ul",o=r&&i!==1?' start="'+i+'"':"";return"<"+a+o+`>
|
|
66
|
+
`+n+"</"+a+`>
|
|
67
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
68
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
69
|
+
`}table(t){let r="",i="";for(let a=0;a<t.header.length;a++)i+=this.tablecell(t.header[a]);r+=this.tablerow({text:i});let n="";for(let a=0;a<t.rows.length;a++){let o=t.rows[a];i="";for(let s=0;s<o.length;s++)i+=this.tablecell(o[s]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
70
|
+
<thead>
|
|
71
|
+
`+r+`</thead>
|
|
72
|
+
`+n+`</table>
|
|
73
|
+
`}tablerow({text:t}){return`<tr>
|
|
74
|
+
${t}</tr>
|
|
75
|
+
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
76
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${_i(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let n=this.parser.parseInline(i),a=Id(t);if(a===null)return n;t=a;let o='<a href="'+t+'"';return r&&(o+=' title="'+_i(r)+'"'),o+=">"+n+"</a>",o}image({href:t,title:r,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let a=Id(t);if(a===null)return _i(i);t=a;let o=`<img src="${t}" alt="${i}"`;return r&&(o+=` title="${_i(r)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:_i(t.text)}},Gh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Xr=class Tc{constructor(t){jt(this,"options");jt(this,"renderer");jt(this,"textRenderer");this.options=t||kn,this.options.renderer=this.options.renderer||new So,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gh}static parse(t,r){return new Tc(r).parse(t)}static parseInline(t,r){return new Tc(r).parseInline(t)}parse(t){var i,n;let r="";for(let a=0;a<t.length;a++){let o=t[a];if((n=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&n[o.type]){let c=o,l=this.options.extensions.renderers[c.type].call({parser:this},c);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){r+=l||"";continue}}let s=o;switch(s.type){case"space":{r+=this.renderer.space(s);break}case"hr":{r+=this.renderer.hr(s);break}case"heading":{r+=this.renderer.heading(s);break}case"code":{r+=this.renderer.code(s);break}case"table":{r+=this.renderer.table(s);break}case"blockquote":{r+=this.renderer.blockquote(s);break}case"list":{r+=this.renderer.list(s);break}case"checkbox":{r+=this.renderer.checkbox(s);break}case"html":{r+=this.renderer.html(s);break}case"def":{r+=this.renderer.def(s);break}case"paragraph":{r+=this.renderer.paragraph(s);break}case"text":{r+=this.renderer.text(s);break}default:{let c='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,r=this.renderer){var n,a;let i="";for(let o=0;o<t.length;o++){let s=t[o];if((a=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&a[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let c=s;switch(c.type){case"escape":{i+=r.text(c);break}case"html":{i+=r.html(c);break}case"link":{i+=r.link(c);break}case"image":{i+=r.image(c);break}case"checkbox":{i+=r.checkbox(c);break}case"strong":{i+=r.strong(c);break}case"em":{i+=r.em(c);break}case"codespan":{i+=r.codespan(c);break}case"br":{i+=r.br(c);break}case"del":{i+=r.del(c);break}case"text":{i+=r.text(c);break}default:{let l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},Ws,Ra=(Ws=class{constructor(t){jt(this,"options");jt(this,"block");this.options=t||kn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Vr.lex:Vr.lexInline}provideParser(){return this.block?Xr.parse:Xr.parseInline}},jt(Ws,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),jt(Ws,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ws),cE=class{constructor(...t){jt(this,"defaults",Fh());jt(this,"options",this.setOptions);jt(this,"parse",this.parseMarkdown(!0));jt(this,"parseInline",this.parseMarkdown(!1));jt(this,"Parser",Xr);jt(this,"Renderer",So);jt(this,"TextRenderer",Gh);jt(this,"Lexer",Vr);jt(this,"Tokenizer",Co);jt(this,"Hooks",Ra);this.use(...t)}walkTokens(t,r){var n,a;let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let c of s.header)i=i.concat(this.walkTokens(c.tokens,r));for(let c of s.rows)for(let l of c)i=i.concat(this.walkTokens(l.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;(a=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(c=>{let l=s[c].flat(1/0);i=i.concat(this.walkTokens(l,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let o=r.renderers[a.name];o?r.renderers[a.name]=function(...s){let c=a.renderer.apply(this,s);return c===!1&&(c=o.apply(this,s)),c}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[a.level];o?o.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),n.extensions=r),i.renderer){let a=this.defaults.renderer||new So(this.defaults);for(let o in i.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,c=i.renderer[s],l=a[s];a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u||""}}n.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new Co(this.defaults);for(let o in i.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,c=i.tokenizer[s],l=a[s];a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u}}n.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new Ra;for(let o in i.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,c=i.hooks[s],l=a[s];Ra.passThroughHooks.has(o)?a[s]=h=>{if(this.defaults.async&&Ra.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await c.call(a,h);return l.call(a,f)})();let u=c.call(a,h);return l.call(a,u)}:a[s]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(a,h);return f===!1&&(f=await l.apply(a,h)),f})();let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u}}n.hooks=a}if(i.walkTokens){let a=this.defaults.walkTokens,o=i.walkTokens;n.walkTokens=function(s){let c=[];return c.push(o.call(this,s)),a&&(c=c.concat(a.call(this,s))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Vr.lex(t,r??this.defaults)}parser(t,r){return Xr.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let n={...i},a={...this.defaults,...n},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(r):r,c=await(a.hooks?await a.hooks.provideLexer():t?Vr.lex:Vr.lexInline)(s,a),l=a.hooks?await a.hooks.processAllTokens(c):c;a.walkTokens&&await Promise.all(this.walkTokens(l,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():t?Xr.parse:Xr.parseInline)(l,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(o);try{a.hooks&&(r=a.hooks.preprocess(r));let s=(a.hooks?a.hooks.provideLexer():t?Vr.lex:Vr.lexInline)(r,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let c=(a.hooks?a.hooks.provideParser():t?Xr.parse:Xr.parseInline)(s,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(s){return o(s)}}}onError(t,r){return i=>{if(i.message+=`
|
|
77
|
+
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+_i(i.message+"",!0)+"</pre>";return r?Promise.resolve(n):n}if(r)return Promise.reject(i);throw i}}},gn=new cE;function $e(e,t){return gn.parse(e,t)}$e.options=$e.setOptions=function(e){return gn.setOptions(e),$e.defaults=gn.defaults,qg($e.defaults),$e};$e.getDefaults=Fh;$e.defaults=kn;$e.use=function(...e){return gn.use(...e),$e.defaults=gn.defaults,qg($e.defaults),$e};$e.walkTokens=function(e,t){return gn.walkTokens(e,t)};$e.parseInline=gn.parseInline;$e.Parser=Xr;$e.parser=Xr.parse;$e.Renderer=So;$e.TextRenderer=Gh;$e.Lexer=Vr;$e.lexer=Vr.lex;$e.Tokenizer=Co;$e.Hooks=Ra;$e.parse=$e;$e.options;$e.setOptions;$e.use;$e.walkTokens;$e.parseInline;Xr.parse;Vr.lex;var Pd={name:"mermaid",version:"11.12.2",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},Ks={exports:{}},hE=Ks.exports,zd;function uE(){return zd||(zd=1,(function(e,t){(function(r,i){e.exports=i()})(hE,(function(){var r=1e3,i=6e4,n=36e5,a="millisecond",o="second",s="minute",c="hour",l="day",h="week",u="month",f="quarter",d="year",p="date",g="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|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,x={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 T=["th","st","nd","rd"],k=_%100;return"["+_+(T[(k-20)%10]||T[k]||T[0])+"]"}},C=function(_,T,k){var S=String(_);return!S||S.length>=T?_:""+Array(T+1-S.length).join(k)+_},A={s:C,z:function(_){var T=-_.utcOffset(),k=Math.abs(T),S=Math.floor(k/60),M=k%60;return(T<=0?"+":"-")+C(S,2,"0")+":"+C(M,2,"0")},m:function _(T,k){if(T.date()<k.date())return-_(k,T);var S=12*(k.year()-T.year())+(k.month()-T.month()),M=T.clone().add(S,u),W=k-M<0,N=T.clone().add(S+(W?-1:1),u);return+(-(S+(k-M)/(W?M-N:N-M))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:u,y:d,w:h,d:l,D:p,h:c,m:s,s:o,ms:a,Q:f}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},B="en",w={};w[B]=x;var E="$isDayjsObject",I=function(_){return _ instanceof z||!(!_||!_[E])},Y=function _(T,k,S){var M;if(!T)return B;if(typeof T=="string"){var W=T.toLowerCase();w[W]&&(M=W),k&&(w[W]=k,M=W);var N=T.split("-");if(!M&&N.length>1)return _(N[0])}else{var O=T.name;w[O]=T,M=O}return!S&&M&&(B=M),M||!S&&B},q=function(_,T){if(I(_))return _.clone();var k=typeof T=="object"?T:{};return k.date=_,k.args=arguments,new z(k)},F=A;F.l=Y,F.i=I,F.w=function(_,T){return q(_,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var z=(function(){function _(k){this.$L=Y(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[E]=!0}var T=_.prototype;return T.parse=function(k){this.$d=(function(S){var M=S.date,W=S.utc;if(M===null)return new Date(NaN);if(F.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(b);if(N){var O=N[2]-1||0,j=(N[7]||"0").substring(0,3);return W?new Date(Date.UTC(N[1],O,N[3]||1,N[4]||0,N[5]||0,N[6]||0,j)):new Date(N[1],O,N[3]||1,N[4]||0,N[5]||0,N[6]||0,j)}}return new Date(M)})(k),this.init()},T.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},T.$utils=function(){return F},T.isValid=function(){return this.$d.toString()!==g},T.isSame=function(k,S){var M=q(k);return this.startOf(S)<=M&&M<=this.endOf(S)},T.isAfter=function(k,S){return q(k)<this.startOf(S)},T.isBefore=function(k,S){return this.endOf(S)<q(k)},T.$g=function(k,S,M){return F.u(k)?this[S]:this.set(M,k)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(k,S){var M=this,W=!!F.u(S)||S,N=F.p(k),O=function(wt,_t){var ot=F.w(M.$u?Date.UTC(M.$y,_t,wt):new Date(M.$y,_t,wt),M);return W?ot:ot.endOf(l)},j=function(wt,_t){return F.w(M.toDate()[wt].apply(M.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(_t)),M)},G=this.$W,X=this.$M,J=this.$D,K="set"+(this.$u?"UTC":"");switch(N){case d:return W?O(1,0):O(31,11);case u:return W?O(1,X):O(0,X+1);case h:var at=this.$locale().weekStart||0,lt=(G<at?G+7:G)-at;return O(W?J-lt:J+(6-lt),X);case l:case p:return j(K+"Hours",0);case c:return j(K+"Minutes",1);case s:return j(K+"Seconds",2);case o:return j(K+"Milliseconds",3);default:return this.clone()}},T.endOf=function(k){return this.startOf(k,!1)},T.$set=function(k,S){var M,W=F.p(k),N="set"+(this.$u?"UTC":""),O=(M={},M[l]=N+"Date",M[p]=N+"Date",M[u]=N+"Month",M[d]=N+"FullYear",M[c]=N+"Hours",M[s]=N+"Minutes",M[o]=N+"Seconds",M[a]=N+"Milliseconds",M)[W],j=W===l?this.$D+(S-this.$W):S;if(W===u||W===d){var G=this.clone().set(p,1);G.$d[O](j),G.init(),this.$d=G.set(p,Math.min(this.$D,G.daysInMonth())).$d}else O&&this.$d[O](j);return this.init(),this},T.set=function(k,S){return this.clone().$set(k,S)},T.get=function(k){return this[F.p(k)]()},T.add=function(k,S){var M,W=this;k=Number(k);var N=F.p(S),O=function(X){var J=q(W);return F.w(J.date(J.date()+Math.round(X*k)),W)};if(N===u)return this.set(u,this.$M+k);if(N===d)return this.set(d,this.$y+k);if(N===l)return O(1);if(N===h)return O(7);var j=(M={},M[s]=i,M[c]=n,M[o]=r,M)[N]||1,G=this.$d.getTime()+k*j;return F.w(G,this)},T.subtract=function(k,S){return this.add(-1*k,S)},T.format=function(k){var S=this,M=this.$locale();if(!this.isValid())return M.invalidDate||g;var W=k||"YYYY-MM-DDTHH:mm:ssZ",N=F.z(this),O=this.$H,j=this.$m,G=this.$M,X=M.weekdays,J=M.months,K=M.meridiem,at=function(_t,ot,Ct,zt){return _t&&(_t[ot]||_t(S,W))||Ct[ot].slice(0,zt)},lt=function(_t){return F.s(O%12||12,_t,"0")},wt=K||function(_t,ot,Ct){var zt=_t<12?"AM":"PM";return Ct?zt.toLowerCase():zt};return W.replace(y,(function(_t,ot){return ot||(function(Ct){switch(Ct){case"YY":return String(S.$y).slice(-2);case"YYYY":return F.s(S.$y,4,"0");case"M":return G+1;case"MM":return F.s(G+1,2,"0");case"MMM":return at(M.monthsShort,G,J,3);case"MMMM":return at(J,G);case"D":return S.$D;case"DD":return F.s(S.$D,2,"0");case"d":return String(S.$W);case"dd":return at(M.weekdaysMin,S.$W,X,2);case"ddd":return at(M.weekdaysShort,S.$W,X,3);case"dddd":return X[S.$W];case"H":return String(O);case"HH":return F.s(O,2,"0");case"h":return lt(1);case"hh":return lt(2);case"a":return wt(O,j,!0);case"A":return wt(O,j,!1);case"m":return String(j);case"mm":return F.s(j,2,"0");case"s":return String(S.$s);case"ss":return F.s(S.$s,2,"0");case"SSS":return F.s(S.$ms,3,"0");case"Z":return N}return null})(_t)||N.replace(":","")}))},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(k,S,M){var W,N=this,O=F.p(S),j=q(k),G=(j.utcOffset()-this.utcOffset())*i,X=this-j,J=function(){return F.m(N,j)};switch(O){case d:W=J()/12;break;case u:W=J();break;case f:W=J()/3;break;case h:W=(X-G)/6048e5;break;case l:W=(X-G)/864e5;break;case c:W=X/n;break;case s:W=X/i;break;case o:W=X/r;break;default:W=X}return M?W:F.a(W)},T.daysInMonth=function(){return this.endOf(u).$D},T.$locale=function(){return w[this.$L]},T.locale=function(k,S){if(!k)return this.$L;var M=this.clone(),W=Y(k,S,!0);return W&&(M.$L=W),M},T.clone=function(){return F.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},_})(),D=z.prototype;return q.prototype=D,[["$ms",a],["$s",o],["$m",s],["$H",c],["$W",l],["$M",u],["$y",d],["$D",p]].forEach((function(_){D[_[1]]=function(T){return this.$g(T,_[0],_[1])}})),q.extend=function(_,T){return _.$i||(_(T,z,q),_.$i=!0),q},q.locale=Y,q.isDayjs=I,q.unix=function(_){return q(1e3*_)},q.en=w[B],q.Ls=w,q.p={},q}))})(Ks)),Ks.exports}var dE=uE();const fE=Eg(dE);var Jg=Object.defineProperty,m=(e,t)=>Jg(e,"name",{value:t,configurable:!0}),pE=(e,t)=>{for(var r in t)Jg(e,r,{get:t[r],enumerable:!0})},vi={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},rt={trace:m((...e)=>{},"trace"),debug:m((...e)=>{},"debug"),info:m((...e)=>{},"info"),warn:m((...e)=>{},"warn"),error:m((...e)=>{},"error"),fatal:m((...e)=>{},"fatal")},Yh=m(function(e="fatal"){let t=vi.fatal;typeof e=="string"?e.toLowerCase()in vi&&(t=vi[e]):typeof e=="number"&&(t=e),rt.trace=()=>{},rt.debug=()=>{},rt.info=()=>{},rt.warn=()=>{},rt.error=()=>{},rt.fatal=()=>{},t<=vi.fatal&&(rt.fatal=console.error?console.error.bind(console,Wr("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Wr("FATAL"))),t<=vi.error&&(rt.error=console.error?console.error.bind(console,Wr("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Wr("ERROR"))),t<=vi.warn&&(rt.warn=console.warn?console.warn.bind(console,Wr("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Wr("WARN"))),t<=vi.info&&(rt.info=console.info?console.info.bind(console,Wr("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Wr("INFO"))),t<=vi.debug&&(rt.debug=console.debug?console.debug.bind(console,Wr("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Wr("DEBUG"))),t<=vi.trace&&(rt.trace=console.debug?console.debug.bind(console,Wr("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Wr("TRACE")))},"setLogLevel"),Wr=m(e=>`%c${fE().format("ss.SSS")} : ${e} : `,"format");const Qs={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 n=r<.5?r*(1+t):r+t-r*t,a=2*r-n;switch(i){case"r":return Qs.hue2rgb(a,n,e+1/3)*255;case"g":return Qs.hue2rgb(a,n,e)*255;case"b":return Qs.hue2rgb(a,n,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const n=Math.max(e,t,r),a=Math.min(e,t,r),o=(n+a)/2;if(i==="l")return o*100;if(n===a)return 0;const s=n-a,c=o>.5?s/(2-n-a):s/(n+a);if(i==="s")return c*100;switch(n){case e:return((t-r)/s+(t<r?6:0))*60;case t:return((r-e)/s+2)*60;case r:return((e-t)/s+4)*60;default:return-1}}},gE={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},mE={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ne={channel:Qs,lang:gE,unit:mE},Oi={};for(let e=0;e<=255;e++)Oi[e]=ne.unit.dec2hex(e);const fr={ALL:0,RGB:1,HSL:2};class bE{constructor(){this.type=fr.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=fr.ALL}is(t){return this.type===t}}class yE{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new bE}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=fr.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:n}=t;r===void 0&&(t.h=ne.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=ne.channel.rgb2hsl(t,"s")),n===void 0&&(t.l=ne.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:n}=t;r===void 0&&(t.r=ne.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=ne.channel.hsl2rgb(t,"g")),n===void 0&&(t.b=ne.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(fr.HSL)&&r!==void 0?r:(this._ensureHSL(),ne.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(fr.HSL)&&r!==void 0?r:(this._ensureHSL(),ne.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(fr.HSL)&&r!==void 0?r:(this._ensureHSL(),ne.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(fr.RGB)&&r!==void 0?r:(this._ensureRGB(),ne.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(fr.RGB)&&r!==void 0?r:(this._ensureRGB(),ne.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(fr.RGB)&&r!==void 0?r:(this._ensureRGB(),ne.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(fr.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(fr.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(fr.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(fr.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(fr.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(fr.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ll=new yE({r:0,g:0,b:0,a:0},"transparent"),Fn={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Fn.re);if(!t)return;const r=t[1],i=parseInt(r,16),n=r.length,a=n%4===0,o=n>4,s=o?1:17,c=o?8:4,l=a?0:-1,h=o?255:15;return ll.set({r:(i>>c*(l+3)&h)*s,g:(i>>c*(l+2)&h)*s,b:(i>>c*(l+1)&h)*s,a:a?(i&h)*s/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:n}=e;return n<1?`#${Oi[Math.round(t)]}${Oi[Math.round(r)]}${Oi[Math.round(i)]}${Oi[Math.round(n*255)]}`:`#${Oi[Math.round(t)]}${Oi[Math.round(r)]}${Oi[Math.round(i)]}`}},on={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(on.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return ne.channel.clamp.h(parseFloat(r)*.9);case"rad":return ne.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ne.channel.clamp.h(parseFloat(r)*360)}}return ne.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(on.re);if(!r)return;const[,i,n,a,o,s]=r;return ll.set({h:on._hue2deg(i),s:ne.channel.clamp.s(parseFloat(n)),l:ne.channel.clamp.l(parseFloat(a)),a:o?ne.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:n}=e;return n<1?`hsla(${ne.lang.round(t)}, ${ne.lang.round(r)}%, ${ne.lang.round(i)}%, ${n})`:`hsl(${ne.lang.round(t)}, ${ne.lang.round(r)}%, ${ne.lang.round(i)}%)`}},qa={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=qa.colors[e];if(t)return Fn.parse(t)},stringify:e=>{const t=Fn.stringify(e);for(const r in qa.colors)if(qa.colors[r]===t)return r}},Oa={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(Oa.re);if(!r)return;const[,i,n,a,o,s,c,l,h]=r;return ll.set({r:ne.channel.clamp.r(n?parseFloat(i)*2.55:parseFloat(i)),g:ne.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:ne.channel.clamp.b(c?parseFloat(s)*2.55:parseFloat(s)),a:l?ne.channel.clamp.a(h?parseFloat(l)/100:parseFloat(l)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:n}=e;return n<1?`rgba(${ne.lang.round(t)}, ${ne.lang.round(r)}, ${ne.lang.round(i)}, ${ne.lang.round(n)})`:`rgb(${ne.lang.round(t)}, ${ne.lang.round(r)}, ${ne.lang.round(i)})`}},pi={format:{keyword:qa,hex:Fn,rgb:Oa,rgba:Oa,hsl:on,hsla:on},parse:e=>{if(typeof e!="string")return e;const t=Fn.parse(e)||Oa.parse(e)||on.parse(e)||qa.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(fr.HSL)||e.data.r===void 0?on.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Oa.stringify(e):Fn.stringify(e)},tm=(e,t)=>{const r=pi.parse(e);for(const i in t)r[i]=ne.channel.clamp[i](t[i]);return pi.stringify(r)},Ha=(e,t,r=0,i=1)=>{if(typeof e!="number")return tm(e,{a:t});const n=ll.set({r:ne.channel.clamp.r(e),g:ne.channel.clamp.g(t),b:ne.channel.clamp.b(r),a:ne.channel.clamp.a(i)});return pi.stringify(n)},xE=e=>{const{r:t,g:r,b:i}=pi.parse(e),n=.2126*ne.channel.toLinear(t)+.7152*ne.channel.toLinear(r)+.0722*ne.channel.toLinear(i);return ne.lang.round(n)},vE=e=>xE(e)>=.5,ps=e=>!vE(e),em=(e,t,r)=>{const i=pi.parse(e),n=i[t],a=ne.channel.clamp[t](n+r);return n!==a&&(i[t]=a),pi.stringify(i)},Bt=(e,t)=>em(e,"l",t),Ut=(e,t)=>em(e,"l",-t),U=(e,t)=>{const r=pi.parse(e),i={};for(const n in t)t[n]&&(i[n]=r[n]+t[n]);return tm(e,i)},_E=(e,t,r=50)=>{const{r:i,g:n,b:a,a:o}=pi.parse(e),{r:s,g:c,b:l,a:h}=pi.parse(t),u=r/100,f=u*2-1,d=o-h,g=((f*d===-1?f:(f+d)/(1+f*d))+1)/2,b=1-g,y=i*g+s*b,x=n*g+c*b,C=a*g+l*b,A=o*u+h*(1-u);return Ha(y,x,C,A)},ft=(e,t=100)=>{const r=pi.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,_E(r,e,t)};/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:rm,setPrototypeOf:Wd,isFrozen:kE,getPrototypeOf:wE,getOwnPropertyDescriptor:CE}=Object;let{freeze:Cr,seal:qr,create:Ec}=Object,{apply:Ac,construct:Mc}=typeof Reflect<"u"&&Reflect;Cr||(Cr=function(t){return t});qr||(qr=function(t){return t});Ac||(Ac=function(t,r){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return t.apply(r,n)});Mc||(Mc=function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return new t(...i)});const $s=Sr(Array.prototype.forEach),SE=Sr(Array.prototype.lastIndexOf),qd=Sr(Array.prototype.pop),ba=Sr(Array.prototype.push),TE=Sr(Array.prototype.splice),Js=Sr(String.prototype.toLowerCase),Gl=Sr(String.prototype.toString),Yl=Sr(String.prototype.match),ya=Sr(String.prototype.replace),EE=Sr(String.prototype.indexOf),AE=Sr(String.prototype.trim),Yr=Sr(Object.prototype.hasOwnProperty),xr=Sr(RegExp.prototype.test),xa=ME(TypeError);function Sr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return Ac(e,t,i)}}function ME(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return Mc(e,r)}}function ve(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Js;Wd&&Wd(e,null);let i=t.length;for(;i--;){let n=t[i];if(typeof n=="string"){const a=r(n);a!==n&&(kE(t)||(t[i]=a),n=a)}e[n]=!0}return e}function LE(e){for(let t=0;t<e.length;t++)Yr(e,t)||(e[t]=null);return e}function li(e){const t=Ec(null);for(const[r,i]of rm(e))Yr(e,r)&&(Array.isArray(i)?t[r]=LE(i):i&&typeof i=="object"&&i.constructor===Object?t[r]=li(i):t[r]=i);return t}function va(e,t){for(;e!==null;){const i=CE(e,t);if(i){if(i.get)return Sr(i.get);if(typeof i.value=="function")return Sr(i.value)}e=wE(e)}function r(){return null}return r}const Hd=Cr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Vl=Cr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xl=Cr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),BE=Cr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zl=Cr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$E=Cr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jd=Cr(["#text"]),Ud=Cr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Kl=Cr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Gd=Cr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rs=Cr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),RE=qr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),OE=qr(/<%[\w\W]*|[\w\W]*%>/gm),NE=qr(/\$\{[\w\W]*/gm),IE=qr(/^data-[\-\w.\u00B7-\uFFFF]+$/),DE=qr(/^aria-[\-\w]+$/),im=qr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FE=qr(/^(?:\w+script|data):/i),PE=qr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nm=qr(/^html$/i),zE=qr(/^[a-z][.\w]*(-[.\w]+)+$/i);var Yd=Object.freeze({__proto__:null,ARIA_ATTR:DE,ATTR_WHITESPACE:PE,CUSTOM_ELEMENT:zE,DATA_ATTR:IE,DOCTYPE_NAME:nm,ERB_EXPR:OE,IS_ALLOWED_URI:im,IS_SCRIPT_OR_DATA:FE,MUSTACHE_EXPR:RE,TMPLIT_EXPR:NE});const _a={element:1,text:3,progressingInstruction:7,comment:8,document:9},WE=function(){return typeof window>"u"?null:window},qE=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(i=r.getAttribute(n));const a="dompurify"+(i?"#"+i:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Vd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function am(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:WE();const t=Pt=>am(Pt);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==_a.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const i=r,n=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:d}=e,p=c.prototype,g=va(p,"cloneNode"),b=va(p,"remove"),y=va(p,"nextSibling"),x=va(p,"childNodes"),C=va(p,"parentNode");if(typeof o=="function"){const Pt=r.createElement("template");Pt.content&&Pt.content.ownerDocument&&(r=Pt.content.ownerDocument)}let A,B="";const{implementation:w,createNodeIterator:E,createDocumentFragment:I,getElementsByTagName:Y}=r,{importNode:q}=i;let F=Vd();t.isSupported=typeof rm=="function"&&typeof C=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:D,TMPLIT_EXPR:_,DATA_ATTR:T,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:S,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:W}=Yd;let{IS_ALLOWED_URI:N}=Yd,O=null;const j=ve({},[...Hd,...Vl,...Xl,...Zl,...jd]);let G=null;const X=ve({},[...Ud,...Kl,...Gd,...Rs]);let J=Object.seal(Ec(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,at=null;const lt=Object.seal(Ec(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let wt=!0,_t=!0,ot=!1,Ct=!0,zt=!1,Ht=!0,gt=!1,Mt=!1,kt=!1,St=!1,Tt=!1,Et=!1,ht=!0,Lt=!1;const fe="user-content-";let oe=!0,me=!1,ee={},yt=null;const Gt=ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Kt=null;const Nt=ve({},["audio","video","img","source","image","track"]);let re=null;const be=ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",Ft="http://www.w3.org/2000/svg",te="http://www.w3.org/1999/xhtml";let pe=te,Qt=!1,Zt=null;const Yt=ve({},[ue,Ft,te],Gl);let he=ve({},["mi","mo","mn","ms","mtext"]),ge=ve({},["annotation-xml"]);const Ie=ve({},["title","style","font","a","script"]);let Me=null;const R=["application/xhtml+xml","text/html"],V="text/html";let Q=null,pt=null;const le=r.createElement("form"),ie=function(P){return P instanceof RegExp||P instanceof Function},ct=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pt&&pt===P)){if((!P||typeof P!="object")&&(P={}),P=li(P),Me=R.indexOf(P.PARSER_MEDIA_TYPE)===-1?V:P.PARSER_MEDIA_TYPE,Q=Me==="application/xhtml+xml"?Gl:Js,O=Yr(P,"ALLOWED_TAGS")?ve({},P.ALLOWED_TAGS,Q):j,G=Yr(P,"ALLOWED_ATTR")?ve({},P.ALLOWED_ATTR,Q):X,Zt=Yr(P,"ALLOWED_NAMESPACES")?ve({},P.ALLOWED_NAMESPACES,Gl):Yt,re=Yr(P,"ADD_URI_SAFE_ATTR")?ve(li(be),P.ADD_URI_SAFE_ATTR,Q):be,Kt=Yr(P,"ADD_DATA_URI_TAGS")?ve(li(Nt),P.ADD_DATA_URI_TAGS,Q):Nt,yt=Yr(P,"FORBID_CONTENTS")?ve({},P.FORBID_CONTENTS,Q):Gt,K=Yr(P,"FORBID_TAGS")?ve({},P.FORBID_TAGS,Q):li({}),at=Yr(P,"FORBID_ATTR")?ve({},P.FORBID_ATTR,Q):li({}),ee=Yr(P,"USE_PROFILES")?P.USE_PROFILES:!1,wt=P.ALLOW_ARIA_ATTR!==!1,_t=P.ALLOW_DATA_ATTR!==!1,ot=P.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=P.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zt=P.SAFE_FOR_TEMPLATES||!1,Ht=P.SAFE_FOR_XML!==!1,gt=P.WHOLE_DOCUMENT||!1,St=P.RETURN_DOM||!1,Tt=P.RETURN_DOM_FRAGMENT||!1,Et=P.RETURN_TRUSTED_TYPE||!1,kt=P.FORCE_BODY||!1,ht=P.SANITIZE_DOM!==!1,Lt=P.SANITIZE_NAMED_PROPS||!1,oe=P.KEEP_CONTENT!==!1,me=P.IN_PLACE||!1,N=P.ALLOWED_URI_REGEXP||im,pe=P.NAMESPACE||te,he=P.MATHML_TEXT_INTEGRATION_POINTS||he,ge=P.HTML_INTEGRATION_POINTS||ge,J=P.CUSTOM_ELEMENT_HANDLING||{},P.CUSTOM_ELEMENT_HANDLING&&ie(P.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=P.CUSTOM_ELEMENT_HANDLING.tagNameCheck),P.CUSTOM_ELEMENT_HANDLING&&ie(P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),P.CUSTOM_ELEMENT_HANDLING&&typeof P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),zt&&(_t=!1),Tt&&(St=!0),ee&&(O=ve({},jd),G=[],ee.html===!0&&(ve(O,Hd),ve(G,Ud)),ee.svg===!0&&(ve(O,Vl),ve(G,Kl),ve(G,Rs)),ee.svgFilters===!0&&(ve(O,Xl),ve(G,Kl),ve(G,Rs)),ee.mathMl===!0&&(ve(O,Zl),ve(G,Gd),ve(G,Rs))),P.ADD_TAGS&&(typeof P.ADD_TAGS=="function"?lt.tagCheck=P.ADD_TAGS:(O===j&&(O=li(O)),ve(O,P.ADD_TAGS,Q))),P.ADD_ATTR&&(typeof P.ADD_ATTR=="function"?lt.attributeCheck=P.ADD_ATTR:(G===X&&(G=li(G)),ve(G,P.ADD_ATTR,Q))),P.ADD_URI_SAFE_ATTR&&ve(re,P.ADD_URI_SAFE_ATTR,Q),P.FORBID_CONTENTS&&(yt===Gt&&(yt=li(yt)),ve(yt,P.FORBID_CONTENTS,Q)),P.ADD_FORBID_CONTENTS&&(yt===Gt&&(yt=li(yt)),ve(yt,P.ADD_FORBID_CONTENTS,Q)),oe&&(O["#text"]=!0),gt&&ve(O,["html","head","body"]),O.table&&(ve(O,["tbody"]),delete K.tbody),P.TRUSTED_TYPES_POLICY){if(typeof P.TRUSTED_TYPES_POLICY.createHTML!="function")throw xa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof P.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=P.TRUSTED_TYPES_POLICY,B=A.createHTML("")}else A===void 0&&(A=qE(d,n)),A!==null&&typeof B=="string"&&(B=A.createHTML(""));Cr&&Cr(P),pt=P}},ut=ve({},[...Vl,...Xl,...BE]),Dt=ve({},[...Zl,...$E]),Te=function(P){let nt=C(P);(!nt||!nt.tagName)&&(nt={namespaceURI:pe,tagName:"template"});const At=Js(P.tagName),Be=Js(nt.tagName);return Zt[P.namespaceURI]?P.namespaceURI===Ft?nt.namespaceURI===te?At==="svg":nt.namespaceURI===ue?At==="svg"&&(Be==="annotation-xml"||he[Be]):!!ut[At]:P.namespaceURI===ue?nt.namespaceURI===te?At==="math":nt.namespaceURI===Ft?At==="math"&&ge[Be]:!!Dt[At]:P.namespaceURI===te?nt.namespaceURI===Ft&&!ge[Be]||nt.namespaceURI===ue&&!he[Be]?!1:!Dt[At]&&(Ie[At]||!ut[At]):!!(Me==="application/xhtml+xml"&&Zt[P.namespaceURI]):!1},ye=function(P){ba(t.removed,{element:P});try{C(P).removeChild(P)}catch{b(P)}},Ye=function(P,nt){try{ba(t.removed,{attribute:nt.getAttributeNode(P),from:nt})}catch{ba(t.removed,{attribute:null,from:nt})}if(nt.removeAttribute(P),P==="is")if(St||Tt)try{ye(nt)}catch{}else try{nt.setAttribute(P,"")}catch{}},Tr=function(P){let nt=null,At=null;if(kt)P="<remove></remove>"+P;else{const qe=Yl(P,/^[\r\n\t ]+/);At=qe&&qe[0]}Me==="application/xhtml+xml"&&pe===te&&(P='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+P+"</body></html>");const Be=A?A.createHTML(P):P;if(pe===te)try{nt=new f().parseFromString(Be,Me)}catch{}if(!nt||!nt.documentElement){nt=w.createDocument(pe,"template",null);try{nt.documentElement.innerHTML=Qt?B:Be}catch{}}const Ve=nt.body||nt.documentElement;return P&&At&&Ve.insertBefore(r.createTextNode(At),Ve.childNodes[0]||null),pe===te?Y.call(nt,gt?"html":"body")[0]:gt?nt.documentElement:Ve},Fe=function(P){return E.call(P.ownerDocument||P,P,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Le=function(P){return P instanceof u&&(typeof P.nodeName!="string"||typeof P.textContent!="string"||typeof P.removeChild!="function"||!(P.attributes instanceof h)||typeof P.removeAttribute!="function"||typeof P.setAttribute!="function"||typeof P.namespaceURI!="string"||typeof P.insertBefore!="function"||typeof P.hasChildNodes!="function")},Ze=function(P){return typeof s=="function"&&P instanceof s};function Qe(Pt,P,nt){$s(Pt,At=>{At.call(t,P,nt,pt)})}const Fr=function(P){let nt=null;if(Qe(F.beforeSanitizeElements,P,null),Le(P))return ye(P),!0;const At=Q(P.nodeName);if(Qe(F.uponSanitizeElement,P,{tagName:At,allowedTags:O}),Ht&&P.hasChildNodes()&&!Ze(P.firstElementChild)&&xr(/<[/\w!]/g,P.innerHTML)&&xr(/<[/\w!]/g,P.textContent)||P.nodeType===_a.progressingInstruction||Ht&&P.nodeType===_a.comment&&xr(/<[/\w]/g,P.data))return ye(P),!0;if(!(lt.tagCheck instanceof Function&<.tagCheck(At))&&(!O[At]||K[At])){if(!K[At]&&Xi(At)&&(J.tagNameCheck instanceof RegExp&&xr(J.tagNameCheck,At)||J.tagNameCheck instanceof Function&&J.tagNameCheck(At)))return!1;if(oe&&!yt[At]){const Be=C(P)||P.parentNode,Ve=x(P)||P.childNodes;if(Ve&&Be){const qe=Ve.length;for(let Je=qe-1;Je>=0;--Je){const ur=g(Ve[Je],!0);ur.__removalCount=(P.__removalCount||0)+1,Be.insertBefore(ur,y(P))}}}return ye(P),!0}return P instanceof c&&!Te(P)||(At==="noscript"||At==="noembed"||At==="noframes")&&xr(/<\/no(script|embed|frames)/i,P.innerHTML)?(ye(P),!0):(zt&&P.nodeType===_a.text&&(nt=P.textContent,$s([z,D,_],Be=>{nt=ya(nt,Be," ")}),P.textContent!==nt&&(ba(t.removed,{element:P.cloneNode()}),P.textContent=nt)),Qe(F.afterSanitizeElements,P,null),!1)},Vi=function(P,nt,At){if(ht&&(nt==="id"||nt==="name")&&(At in r||At in le))return!1;if(!(_t&&!at[nt]&&xr(T,nt))){if(!(wt&&xr(k,nt))){if(!(lt.attributeCheck instanceof Function&<.attributeCheck(nt,P))){if(!G[nt]||at[nt]){if(!(Xi(P)&&(J.tagNameCheck instanceof RegExp&&xr(J.tagNameCheck,P)||J.tagNameCheck instanceof Function&&J.tagNameCheck(P))&&(J.attributeNameCheck instanceof RegExp&&xr(J.attributeNameCheck,nt)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(nt,P))||nt==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&xr(J.tagNameCheck,At)||J.tagNameCheck instanceof Function&&J.tagNameCheck(At))))return!1}else if(!re[nt]){if(!xr(N,ya(At,M,""))){if(!((nt==="src"||nt==="xlink:href"||nt==="href")&&P!=="script"&&EE(At,"data:")===0&&Kt[P])){if(!(ot&&!xr(S,ya(At,M,"")))){if(At)return!1}}}}}}}return!0},Xi=function(P){return P!=="annotation-xml"&&Yl(P,W)},Gr=function(P){Qe(F.beforeSanitizeAttributes,P,null);const{attributes:nt}=P;if(!nt||Le(P))return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let Be=nt.length;for(;Be--;){const Ve=nt[Be],{name:qe,namespaceURI:Je,value:ur}=Ve,ii=Q(qe),st=ur;let dt=qe==="value"?st:AE(st);if(At.attrName=ii,At.attrValue=dt,At.keepAttr=!0,At.forceKeepAttr=void 0,Qe(F.uponSanitizeAttribute,P,At),dt=At.attrValue,Lt&&(ii==="id"||ii==="name")&&(Ye(qe,P),dt=fe+dt),Ht&&xr(/((--!?|])>)|<\/(style|title|textarea)/i,dt)){Ye(qe,P);continue}if(ii==="attributename"&&Yl(dt,"href")){Ye(qe,P);continue}if(At.forceKeepAttr)continue;if(!At.keepAttr){Ye(qe,P);continue}if(!Ct&&xr(/\/>/i,dt)){Ye(qe,P);continue}zt&&$s([z,D,_],_e=>{dt=ya(dt,_e," ")});const ce=Q(P.nodeName);if(!Vi(ce,ii,dt)){Ye(qe,P);continue}if(A&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Je)switch(d.getAttributeType(ce,ii)){case"TrustedHTML":{dt=A.createHTML(dt);break}case"TrustedScriptURL":{dt=A.createScriptURL(dt);break}}if(dt!==st)try{Je?P.setAttributeNS(Je,qe,dt):P.setAttribute(qe,dt),Le(P)?ye(P):qd(t.removed)}catch{Ye(qe,P)}}Qe(F.afterSanitizeAttributes,P,null)},An=function Pt(P){let nt=null;const At=Fe(P);for(Qe(F.beforeSanitizeShadowDOM,P,null);nt=At.nextNode();)Qe(F.uponSanitizeShadowNode,nt,null),Fr(nt),Gr(nt),nt.content instanceof a&&Pt(nt.content);Qe(F.afterSanitizeShadowDOM,P,null)};return t.sanitize=function(Pt){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt=null,At=null,Be=null,Ve=null;if(Qt=!Pt,Qt&&(Pt="<!-->"),typeof Pt!="string"&&!Ze(Pt))if(typeof Pt.toString=="function"){if(Pt=Pt.toString(),typeof Pt!="string")throw xa("dirty is not a string, aborting")}else throw xa("toString is not a function");if(!t.isSupported)return Pt;if(Mt||ct(P),t.removed=[],typeof Pt=="string"&&(me=!1),me){if(Pt.nodeName){const ur=Q(Pt.nodeName);if(!O[ur]||K[ur])throw xa("root node is forbidden and cannot be sanitized in-place")}}else if(Pt instanceof s)nt=Tr("<!---->"),At=nt.ownerDocument.importNode(Pt,!0),At.nodeType===_a.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?nt=At:nt.appendChild(At);else{if(!St&&!zt&&!gt&&Pt.indexOf("<")===-1)return A&&Et?A.createHTML(Pt):Pt;if(nt=Tr(Pt),!nt)return St?null:Et?B:""}nt&&kt&&ye(nt.firstChild);const qe=Fe(me?Pt:nt);for(;Be=qe.nextNode();)Fr(Be),Gr(Be),Be.content instanceof a&&An(Be.content);if(me)return Pt;if(St){if(Tt)for(Ve=I.call(nt.ownerDocument);nt.firstChild;)Ve.appendChild(nt.firstChild);else Ve=nt;return(G.shadowroot||G.shadowrootmode)&&(Ve=q.call(i,Ve,!0)),Ve}let Je=gt?nt.outerHTML:nt.innerHTML;return gt&&O["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&&xr(nm,nt.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+nt.ownerDocument.doctype.name+`>
|
|
78
|
+
`+Je),zt&&$s([z,D,_],ur=>{Je=ya(Je,ur," ")}),A&&Et?A.createHTML(Je):Je},t.setConfig=function(){let Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ct(Pt),Mt=!0},t.clearConfig=function(){pt=null,Mt=!1},t.isValidAttribute=function(Pt,P,nt){pt||ct({});const At=Q(Pt),Be=Q(P);return Vi(At,Be,nt)},t.addHook=function(Pt,P){typeof P=="function"&&ba(F[Pt],P)},t.removeHook=function(Pt,P){if(P!==void 0){const nt=SE(F[Pt],P);return nt===-1?void 0:TE(F[Pt],nt,1)[0]}return qd(F[Pt])},t.removeHooks=function(Pt){F[Pt]=[]},t.removeAllHooks=function(){F=Vd()},t}var Qn=am(),sm=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,ja=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,HE=/\s*%%.*\n/gm,zn,om=(zn=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},m(zn,"UnknownDiagramError"),zn),mn={},Vh=m(function(e,t){e=e.replace(sm,"").replace(ja,"").replace(HE,`
|
|
79
|
+
`);for(const[r,{detector:i}]of Object.entries(mn))if(i(e,t))return r;throw new om(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Lc=m((...e)=>{for(const{id:t,detector:r,loader:i}of e)lm(t,r,i)},"registerLazyLoadedDiagrams"),lm=m((e,t,r)=>{mn[e]&&rt.warn(`Detector with key ${e} already exists. Overwriting.`),mn[e]={detector:t,loader:r},rt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),jE=m(e=>mn[e].loader,"getDiagramLoader"),Bc=m((e,t,{depth:r=2,clobber:i=!1}={})=>{const n={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(a=>Bc(e,a,n)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(a=>{e.includes(a)||e.push(a)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(a=>{typeof t[a]=="object"&&(e[a]===void 0||typeof e[a]=="object")?(e[a]===void 0&&(e[a]=Array.isArray(t[a])?[]:{}),e[a]=Bc(e[a],t[a],{depth:r-1,clobber:i})):(i||typeof e[a]!="object"&&typeof t[a]!="object")&&(e[a]=t[a])}),e)},"assignWithDepth"),er=Bc,cl="#ffffff",hl="#f2f2f2",_r=m((e,t)=>t?U(e,{s:-40,l:10}):U(e,{s:-40,l:-10}),"mkBorder"),Wn,UE=(Wn=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,i,n,a,o,s,c,l,h,u,f,d,p,g,b,y,x,C,A,B,w;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||U(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||U(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||_r(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||_r(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ft(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ft(this.tertiaryColor),this.lineColor=this.lineColor||ft(this.background),this.arrowheadColor=this.arrowheadColor||ft(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?Ut(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||Ut(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ft(this.lineColor),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||Bt(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.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Ut(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ut(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Bt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Bt(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||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330}),this.darkMode)for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScale"+E]=Ut(this["cScale"+E],75);else for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScale"+E]=Ut(this["cScale"+E],25);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||ft(this["cScale"+E]);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this.darkMode?this["cScalePeer"+E]=this["cScalePeer"+E]||Bt(this["cScale"+E],10):this["cScalePeer"+E]=this["cScalePeer"+E]||Ut(this["cScale"+E],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||U(this.mainBkg,{h:180,s:-15,l:t*(5+E*3)}),this["surfacePeer"+E]=this["surfacePeer"+E]||U(this.mainBkg,{h:180,s:-15,l:t*(8+E*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||U(this.primaryColor,{h:64}),this.fillType3=this.fillType3||U(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||U(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||U(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||U(this.primaryColor,{h:128}),this.fillType7=this.fillType7||U(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||U(this.primaryColor,{l:-10}),this.pie5=this.pie5||U(this.secondaryColor,{l:-10}),this.pie6=this.pie6||U(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||U(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||U(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||U(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||U(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||U(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||U(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:((r=this.radar)==null?void 0:r.axisColor)||this.lineColor,axisStrokeWidth:((i=this.radar)==null?void 0:i.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((a=this.radar)==null?void 0:a.curveOpacity)||.5,curveStrokeWidth:((o=this.radar)==null?void 0:o.curveStrokeWidth)||2,graticuleColor:((s=this.radar)==null?void 0:s.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((c=this.radar)==null?void 0:c.graticuleStrokeWidth)||1,graticuleOpacity:((l=this.radar)==null?void 0:l.graticuleOpacity)||.3,legendBoxSize:((h=this.radar)==null?void 0:h.legendBoxSize)||12,legendFontSize:((u=this.radar)==null?void 0:u.legendFontSize)||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ps(this.quadrant1Fill)?Bt(this.quadrant1Fill):Ut(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((f=this.xyChart)==null?void 0:f.backgroundColor)||this.background,titleColor:((d=this.xyChart)==null?void 0:d.titleColor)||this.primaryTextColor,xAxisTitleColor:((p=this.xyChart)==null?void 0:p.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((g=this.xyChart)==null?void 0:g.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((b=this.xyChart)==null?void 0:b.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((y=this.xyChart)==null?void 0:y.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((x=this.xyChart)==null?void 0:x.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((C=this.xyChart)==null?void 0:C.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((A=this.xyChart)==null?void 0:A.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((B=this.xyChart)==null?void 0:B.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((w=this.xyChart)==null?void 0:w.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Ut(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||U(this.primaryColor,{h:-30}),this.git4=this.git4||U(this.primaryColor,{h:-60}),this.git5=this.git5||U(this.primaryColor,{h:-90}),this.git6=this.git6||U(this.primaryColor,{h:60}),this.git7=this.git7||U(this.primaryColor,{h:120}),this.darkMode?(this.git0=Bt(this.git0,25),this.git1=Bt(this.git1,25),this.git2=Bt(this.git2,25),this.git3=Bt(this.git3,25),this.git4=Bt(this.git4,25),this.git5=Bt(this.git5,25),this.git6=Bt(this.git6,25),this.git7=Bt(this.git7,25)):(this.git0=Ut(this.git0,25),this.git1=Ut(this.git1,25),this.git2=Ut(this.git2,25),this.git3=Ut(this.git3,25),this.git4=Ut(this.git4,25),this.git5=Ut(this.git5,25),this.git6=Ut(this.git6,25),this.git7=Ut(this.git7,25)),this.gitInv0=this.gitInv0||ft(this.git0),this.gitInv1=this.gitInv1||ft(this.git1),this.gitInv2=this.gitInv2||ft(this.git2),this.gitInv3=this.gitInv3||ft(this.git3),this.gitInv4=this.gitInv4||ft(this.git4),this.gitInv5=this.gitInv5||ft(this.git5),this.gitInv6=this.gitInv6||ft(this.git6),this.gitInv7=this.gitInv7||ft(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||cl,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||hl}calculate(t){if(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]})}},m(Wn,"Theme"),Wn),GE=m(e=>{const t=new UE;return t.calculate(e),t},"getThemeVariables"),qn,YE=(qn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Bt(this.primaryColor,16),this.tertiaryColor=U(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.background),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=ft(this.primaryColor),this.secondaryTextColor=ft(this.secondaryColor),this.tertiaryTextColor=ft(this.tertiaryColor),this.lineColor=ft(this.background),this.textColor=ft(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Bt(ft("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ha(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.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.sectionBkgColor=Ut("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Ut(this.sectionBkgColor,10),this.taskBorderColor=Ha(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ha(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||Bt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ut(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,g,b,y,x,C,A,B;this.secondBkg=Bt(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=Bt(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.altSectionBkgColor=this.background,this.taskBkgColor=Bt(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=this.darkTextColor,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=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(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||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330});for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||ft(this["cScale"+w]);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScalePeer"+w]=this["cScalePeer"+w]||Bt(this["cScale"+w],10);for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||U(this.mainBkg,{h:30,s:-30,l:-(-10+w*4)}),this["surfacePeer"+w]=this["surfacePeer"+w]||U(this.mainBkg,{h:30,s:-30,l:-(-7+w*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.scaleLabelColor;for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["pie"+w]=this["cScale"+w];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ps(this.quadrant1Fill)?Bt(this.quadrant1Fill):Ut(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((n=this.xyChart)==null?void 0:n.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((s=this.xyChart)==null?void 0:s.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((l=this.xyChart)==null?void 0:l.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((h=this.xyChart)==null?void 0:h.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((u=this.xyChart)==null?void 0:u.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:((f=this.radar)==null?void 0:f.axisColor)||this.lineColor,axisStrokeWidth:((d=this.radar)==null?void 0:d.axisStrokeWidth)||2,axisLabelFontSize:((p=this.radar)==null?void 0:p.axisLabelFontSize)||12,curveOpacity:((g=this.radar)==null?void 0:g.curveOpacity)||.5,curveStrokeWidth:((b=this.radar)==null?void 0:b.curveStrokeWidth)||2,graticuleColor:((y=this.radar)==null?void 0:y.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((x=this.radar)==null?void 0:x.graticuleStrokeWidth)||1,graticuleOpacity:((C=this.radar)==null?void 0:C.graticuleOpacity)||.3,legendBoxSize:((A=this.radar)==null?void 0:A.legendBoxSize)||12,legendFontSize:((B=this.radar)==null?void 0:B.legendFontSize)||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Ut(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Bt(this.secondaryColor,20),this.git1=Bt(this.pie2||this.secondaryColor,20),this.git2=Bt(this.pie3||this.tertiaryColor,20),this.git3=Bt(this.pie4||U(this.primaryColor,{h:-30}),20),this.git4=Bt(this.pie5||U(this.primaryColor,{h:-60}),20),this.git5=Bt(this.pie6||U(this.primaryColor,{h:-90}),10),this.git6=Bt(this.pie7||U(this.primaryColor,{h:60}),10),this.git7=Bt(this.pie8||U(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||ft(this.git0),this.gitInv1=this.gitInv1||ft(this.git1),this.gitInv2=this.gitInv2||ft(this.git2),this.gitInv3=this.gitInv3||ft(this.git3),this.gitInv4=this.gitInv4||ft(this.git4),this.gitInv5=this.gitInv5||ft(this.git5),this.gitInv6=this.gitInv6||ft(this.git6),this.gitInv7=this.gitInv7||ft(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ft(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ft(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Bt(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Bt(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(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]})}},m(qn,"Theme"),qn),VE=m(e=>{const t=new YE;return t.calculate(e),t},"getThemeVariables"),Hn,XE=(Hn=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=U(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=U(this.primaryColor,{h:-160}),this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=ft(this.primaryColor),this.secondaryTextColor=ft(this.secondaryColor),this.tertiaryTextColor=ft(this.tertiaryColor),this.lineColor=ft(this.background),this.textColor=ft(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",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.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.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=Ha(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.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.updateColors()}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,g,b,y,x,C,A,B;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ut(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ut(this.tertiaryColor,40);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScale"+w]=Ut(this["cScale"+w],10),this["cScalePeer"+w]=this["cScalePeer"+w]||Ut(this["cScale"+w],25);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||U(this["cScale"+w],{h:180});for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||U(this.mainBkg,{h:30,l:-(5+w*5)}),this["surfacePeer"+w]=this["surfacePeer"+w]||U(this.mainBkg,{h:30,l:-(7+w*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||ft(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||ft(this.labelTextColor);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=Bt(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Bt(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Bt(this.primaryColor,1),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.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||U(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||U(this.primaryColor,{l:-10}),this.pie5=this.pie5||U(this.secondaryColor,{l:-30}),this.pie6=this.pie6||U(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||U(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||U(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||U(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||U(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||U(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||U(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ps(this.quadrant1Fill)?Bt(this.quadrant1Fill):Ut(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((n=this.radar)==null?void 0:n.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((o=this.radar)==null?void 0:o.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((s=this.radar)==null?void 0:s.graticuleStrokeWidth)||1,graticuleOpacity:((c=this.radar)==null?void 0:c.graticuleOpacity)||.3,legendBoxSize:((l=this.radar)==null?void 0:l.legendBoxSize)||12,legendFontSize:((h=this.radar)==null?void 0:h.legendFontSize)||12},this.xyChart={backgroundColor:((u=this.xyChart)==null?void 0:u.backgroundColor)||this.background,titleColor:((f=this.xyChart)==null?void 0:f.titleColor)||this.primaryTextColor,xAxisTitleColor:((d=this.xyChart)==null?void 0:d.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((p=this.xyChart)==null?void 0:p.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((g=this.xyChart)==null?void 0:g.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((b=this.xyChart)==null?void 0:b.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((y=this.xyChart)==null?void 0:y.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((x=this.xyChart)==null?void 0:x.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((C=this.xyChart)==null?void 0:C.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((A=this.xyChart)==null?void 0:A.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((B=this.xyChart)==null?void 0:B.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||U(this.primaryColor,{h:-30}),this.git4=this.git4||U(this.primaryColor,{h:-60}),this.git5=this.git5||U(this.primaryColor,{h:-90}),this.git6=this.git6||U(this.primaryColor,{h:60}),this.git7=this.git7||U(this.primaryColor,{h:120}),this.darkMode?(this.git0=Bt(this.git0,25),this.git1=Bt(this.git1,25),this.git2=Bt(this.git2,25),this.git3=Bt(this.git3,25),this.git4=Bt(this.git4,25),this.git5=Bt(this.git5,25),this.git6=Bt(this.git6,25),this.git7=Bt(this.git7,25)):(this.git0=Ut(this.git0,25),this.git1=Ut(this.git1,25),this.git2=Ut(this.git2,25),this.git3=Ut(this.git3,25),this.git4=Ut(this.git4,25),this.git5=Ut(this.git5,25),this.git6=Ut(this.git6,25),this.git7=Ut(this.git7,25)),this.gitInv0=this.gitInv0||Ut(ft(this.git0),25),this.gitInv1=this.gitInv1||ft(this.git1),this.gitInv2=this.gitInv2||ft(this.git2),this.gitInv3=this.gitInv3||ft(this.git3),this.gitInv4=this.gitInv4||ft(this.git4),this.gitInv5=this.gitInv5||ft(this.git5),this.gitInv6=this.gitInv6||ft(this.git6),this.gitInv7=this.gitInv7||ft(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ft(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ft(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||cl,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||hl}calculate(t){if(Object.keys(this).forEach(i=>{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]})}},m(Hn,"Theme"),Hn),ZE=m(e=>{const t=new XE;return t.calculate(e),t},"getThemeVariables"),jn,KE=(jn=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=Bt("#cde498",10),this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=ft(this.primaryColor),this.secondaryTextColor=ft(this.secondaryColor),this.tertiaryTextColor=ft(this.primaryColor),this.lineColor=ft(this.background),this.textColor=ft(this.background),this.THEME_COLOR_LIMIT=12,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.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,g,b,y,x,C,A,B;this.actorBorder=Ut(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.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ut(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ut(this.tertiaryColor,40);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScale"+w]=Ut(this["cScale"+w],10),this["cScalePeer"+w]=this["cScalePeer"+w]||Ut(this["cScale"+w],25);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||U(this["cScale"+w],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.scaleLabelColor;for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||U(this.mainBkg,{h:30,s:-30,l:-(5+w*5)}),this["surfacePeer"+w]=this["surfacePeer"+w]||U(this.mainBkg,{h:30,s:-30,l:-(8+w*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Bt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Bt(this.mainBkg,20),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.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||U(this.primaryColor,{l:-30}),this.pie5=this.pie5||U(this.secondaryColor,{l:-30}),this.pie6=this.pie6||U(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||U(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||U(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||U(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||U(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||U(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||U(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ps(this.quadrant1Fill)?Bt(this.quadrant1Fill):Ut(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((n=this.radar)==null?void 0:n.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((o=this.radar)==null?void 0:o.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((s=this.radar)==null?void 0:s.graticuleStrokeWidth)||1,graticuleOpacity:((c=this.radar)==null?void 0:c.graticuleOpacity)||.3,legendBoxSize:((l=this.radar)==null?void 0:l.legendBoxSize)||12,legendFontSize:((h=this.radar)==null?void 0:h.legendFontSize)||12},this.xyChart={backgroundColor:((u=this.xyChart)==null?void 0:u.backgroundColor)||this.background,titleColor:((f=this.xyChart)==null?void 0:f.titleColor)||this.primaryTextColor,xAxisTitleColor:((d=this.xyChart)==null?void 0:d.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((p=this.xyChart)==null?void 0:p.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((g=this.xyChart)==null?void 0:g.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((b=this.xyChart)==null?void 0:b.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((y=this.xyChart)==null?void 0:y.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((x=this.xyChart)==null?void 0:x.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((C=this.xyChart)==null?void 0:C.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((A=this.xyChart)==null?void 0:A.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((B=this.xyChart)==null?void 0:B.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||U(this.primaryColor,{h:-30}),this.git4=this.git4||U(this.primaryColor,{h:-60}),this.git5=this.git5||U(this.primaryColor,{h:-90}),this.git6=this.git6||U(this.primaryColor,{h:60}),this.git7=this.git7||U(this.primaryColor,{h:120}),this.darkMode?(this.git0=Bt(this.git0,25),this.git1=Bt(this.git1,25),this.git2=Bt(this.git2,25),this.git3=Bt(this.git3,25),this.git4=Bt(this.git4,25),this.git5=Bt(this.git5,25),this.git6=Bt(this.git6,25),this.git7=Bt(this.git7,25)):(this.git0=Ut(this.git0,25),this.git1=Ut(this.git1,25),this.git2=Ut(this.git2,25),this.git3=Ut(this.git3,25),this.git4=Ut(this.git4,25),this.git5=Ut(this.git5,25),this.git6=Ut(this.git6,25),this.git7=Ut(this.git7,25)),this.gitInv0=this.gitInv0||ft(this.git0),this.gitInv1=this.gitInv1||ft(this.git1),this.gitInv2=this.gitInv2||ft(this.git2),this.gitInv3=this.gitInv3||ft(this.git3),this.gitInv4=this.gitInv4||ft(this.git4),this.gitInv5=this.gitInv5||ft(this.git5),this.gitInv6=this.gitInv6||ft(this.git6),this.gitInv7=this.gitInv7||ft(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ft(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ft(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||cl,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||hl}calculate(t){if(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]})}},m(jn,"Theme"),jn),QE=m(e=>{const t=new KE;return t.calculate(e),t},"getThemeVariables"),Un,JE=(Un=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Bt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=U(this.primaryColor,{h:-160}),this.primaryBorderColor=_r(this.primaryColor,this.darkMode),this.secondaryBorderColor=_r(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=_r(this.tertiaryColor,this.darkMode),this.primaryTextColor=ft(this.primaryColor),this.secondaryTextColor=ft(this.secondaryColor),this.tertiaryTextColor=ft(this.tertiaryColor),this.lineColor=ft(this.background),this.textColor=ft(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.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.rowOdd=this.rowOdd||Bt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,n,a,o,s,c,l,h,u,f,d,p,g,b,y,x,C,A,B;this.secondBkg=Bt(this.contrast,55),this.border2=this.contrast,this.actorBorder=Bt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,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 w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleInv"+w]=this["cScaleInv"+w]||ft(this["cScale"+w]);for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this.darkMode?this["cScalePeer"+w]=this["cScalePeer"+w]||Bt(this["cScale"+w],10):this["cScalePeer"+w]=this["cScalePeer"+w]||Ut(this["cScale"+w],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["cScaleLabel"+w]=this["cScaleLabel"+w]||this.scaleLabelColor;for(let w=0;w<5;w++)this["surface"+w]=this["surface"+w]||U(this.mainBkg,{l:-(5+w*5)}),this["surfacePeer"+w]=this["surfacePeer"+w]||U(this.mainBkg,{l:-(8+w*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Bt(this.contrast,30),this.sectionBkgColor2=Bt(this.contrast,30),this.taskBorderColor=Ut(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Bt(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Ut(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",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||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(this.secondaryColor,{h:128});for(let w=0;w<this.THEME_COLOR_LIMIT;w++)this["pie"+w]=this["cScale"+w];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ps(this.quadrant1Fill)?Bt(this.quadrant1Fill):Ut(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((n=this.xyChart)==null?void 0:n.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((s=this.xyChart)==null?void 0:s.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((c=this.xyChart)==null?void 0:c.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((l=this.xyChart)==null?void 0:l.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((h=this.xyChart)==null?void 0:h.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((u=this.xyChart)==null?void 0:u.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((f=this.radar)==null?void 0:f.axisColor)||this.lineColor,axisStrokeWidth:((d=this.radar)==null?void 0:d.axisStrokeWidth)||2,axisLabelFontSize:((p=this.radar)==null?void 0:p.axisLabelFontSize)||12,curveOpacity:((g=this.radar)==null?void 0:g.curveOpacity)||.5,curveStrokeWidth:((b=this.radar)==null?void 0:b.curveStrokeWidth)||2,graticuleColor:((y=this.radar)==null?void 0:y.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((x=this.radar)==null?void 0:x.graticuleStrokeWidth)||1,graticuleOpacity:((C=this.radar)==null?void 0:C.graticuleOpacity)||.3,legendBoxSize:((A=this.radar)==null?void 0:A.legendBoxSize)||12,legendFontSize:((B=this.radar)==null?void 0:B.legendFontSize)||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ut(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||U(this.primaryColor,{h:-30}),this.git4=this.pie5||U(this.primaryColor,{h:-60}),this.git5=this.pie6||U(this.primaryColor,{h:-90}),this.git6=this.pie7||U(this.primaryColor,{h:60}),this.git7=this.pie8||U(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||ft(this.git0),this.gitInv1=this.gitInv1||ft(this.git1),this.gitInv2=this.gitInv2||ft(this.git2),this.gitInv3=this.gitInv3||ft(this.git3),this.gitInv4=this.gitInv4||ft(this.git4),this.gitInv5=this.gitInv5||ft(this.git5),this.gitInv6=this.gitInv6||ft(this.git6),this.gitInv7=this.gitInv7||ft(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||cl,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||hl}calculate(t){if(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]})}},m(Un,"Theme"),Un),tA=m(e=>{const t=new JE;return t.calculate(e),t},"getThemeVariables"),Ei={base:{getThemeVariables:GE},dark:{getThemeVariables:VE},default:{getThemeVariables:ZE},forest:{getThemeVariables:QE},neutral:{getThemeVariables:tA}},si={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!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},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},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,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},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},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"},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:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},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},cm={...si,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Ei.default.getThemeVariables(),sequence:{...si.sequence,messageFont:m(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:m(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:m(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...si.gantt,tickInterval:void 0,useWidth:void 0},c4:{...si.c4,useWidth:void 0,personFont:m(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...si.flowchart,inheritDir:!1},external_personFont:m(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:m(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:m(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:m(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:m(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:m(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:m(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:m(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:m(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:m(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:m(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:m(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:m(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:m(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:m(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:m(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:m(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:m(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:m(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:m(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:m(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...si.pie,useWidth:984},xyChart:{...si.xyChart,useWidth:void 0},requirement:{...si.requirement,useWidth:void 0},packet:{...si.packet},radar:{...si.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},hm=m((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...hm(e[i],"")]:[...r,t+i],[]),"keyify"),eA=new Set(hm(cm,"")),um=cm,To=m(e=>{if(rt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>To(t));return}for(const t of Object.keys(e)){if(rt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!eA.has(t)||e[t]==null){rt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){rt.debug("sanitizing object",t),To(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(rt.debug("sanitizing css option",t),e[t]=rA(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]="")}rt.debug("After sanitization",e)}},"sanitizeDirective"),rA=m(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Jn=Object.freeze(um),Mr=er({},Jn),Eo,bn=[],Ua=er({},Jn),ul=m((e,t)=>{let r=er({},e),i={};for(const n of t)pm(n),i=er(i,n);if(r=er(r,i),i.theme&&i.theme in Ei){const n=er({},Eo),a=er(n.themeVariables||{},i.themeVariables);r.theme&&r.theme in Ei&&(r.themeVariables=Ei[r.theme].getThemeVariables(a))}return Ua=r,gm(Ua),Ua},"updateCurrentConfig"),iA=m(e=>(Mr=er({},Jn),Mr=er(Mr,e),e.theme&&Ei[e.theme]&&(Mr.themeVariables=Ei[e.theme].getThemeVariables(e.themeVariables)),ul(Mr,bn),Mr),"setSiteConfig"),nA=m(e=>{Eo=er({},e)},"saveConfigFromInitialize"),aA=m(e=>(Mr=er(Mr,e),ul(Mr,bn),Mr),"updateSiteConfig"),dm=m(()=>er({},Mr),"getSiteConfig"),fm=m(e=>(gm(e),er(Ua,e),gr()),"setConfig"),gr=m(()=>er({},Ua),"getConfig"),pm=m(e=>{e&&(["secure",...Mr.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(rt.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"&&pm(e[t])}))},"sanitize"),sA=m(e=>{var t;To(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),bn.push(e),ul(Mr,bn)},"addDirective"),Ao=m((e=Mr)=>{bn=[],ul(e,bn)},"reset"),oA={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Xd={},lA=m(e=>{Xd[e]||(rt.warn(oA[e]),Xd[e]=!0)},"issueWarning"),gm=m(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&lA("LAZY_LOAD_DEPRECATED")},"checkConfig"),TD=m(()=>{let e={};Eo&&(e=er(e,Eo));for(const t of bn)e=er(e,t);return e},"getUserDefinedConfig"),gs=/<br\s*\/?>/gi,cA=m(e=>e?ym(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),hA=(()=>{let e=!1;return()=>{e||(mm(),e=!0)}})();function mm(){const e="data-temp-href-target";Qn.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Qn.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"))})}m(mm,"setupDompurifyHooks");var bm=m(e=>(hA(),Qn.sanitize(e)),"removeScript"),Zd=m((e,t)=>{var r;if(((r=t.flowchart)==null?void 0:r.htmlLabels)!==!1){const i=t.securityLevel;i==="antiscript"||i==="strict"?e=bm(e):i!=="loose"&&(e=ym(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=pA(e))}return e},"sanitizeMore"),Hr=m((e,t)=>e&&(t.dompurifyConfig?e=Qn.sanitize(Zd(e,t),t.dompurifyConfig).toString():e=Qn.sanitize(Zd(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),uA=m((e,t)=>typeof e=="string"?Hr(e,t):e.flat().map(r=>Hr(r,t)),"sanitizeTextOrArray"),dA=m(e=>gs.test(e),"hasBreaks"),fA=m(e=>e.split(gs),"splitBreaks"),pA=m(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),ym=m(e=>e.replace(gs,"#br#"),"breakToPlaceholder"),gA=m(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),nr=m(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),mA=m(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),bA=m(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Kd=m(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let n=t[i];if(n===","&&i>0&&i+1<t.length){const a=t[i-1],o=t[i+1];yA(a,o)&&(n=a+","+o,i++,r.pop())}r.push(xA(n))}return r.join("")},"parseGenericTypes"),$c=m((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),yA=m((e,t)=>{const r=$c(e,"~"),i=$c(t,"~");return r===1&&i===1},"shouldCombineSets"),xA=m(e=>{const t=$c(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let n=i.indexOf("~"),a=i.lastIndexOf("~");for(;n!==-1&&a!==-1&&n!==a;)i[n]="<",i[a]=">",n=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Qd=m(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Rc=/\$\$(.*)\$\$/g,ta=m(e=>{var t;return(((t=e.match(Rc))==null?void 0:t.length)??0)>0},"hasKatex"),ED=m(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Xh(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 n={width:r.clientWidth,height:r.clientHeight};return r.remove(),n},"calculateMathMLDimensions"),vA=m(async(e,t)=>{if(!ta(e))return e;if(!(Qd()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Rc,"MathML is unsupported in this environment.");{const{default:r}=await Ne(async()=>{const{default:n}=await import("./Cu_Erd72.js");return{default:n}},[],import.meta.url),i=t.forceLegacyMathML||!Qd()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(gs).map(n=>ta(n)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${n}</div>`:`<div>${n}</div>`).join("").replace(Rc,(n,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Xh=m(async(e,t)=>Hr(await vA(e,t),t),"renderKatexSanitized"),sa={getRows:cA,sanitizeText:Hr,sanitizeTextOrArray:uA,hasBreaks:dA,splitBreaks:fA,lineBreakRegex:gs,removeScript:bm,getUrl:gA,evaluate:nr,getMax:mA,getMin:bA},_A=m(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),kA=m(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"),xm=m(function(e,t,r,i){const n=kA(t,r,i);_A(e,n)},"configureSvgSize"),wA=m(function(e,t,r,i){const n=t.node().getBBox(),a=n.width,o=n.height;rt.info(`SVG bounds: ${a}x${o}`,n);let s=0,c=0;rt.info(`Graph bounds: ${s}x${c}`,e),s=a+r*2,c=o+r*2,rt.info(`Calculated bounds: ${s}x${c}`),xm(t,c,s,i);const l=`${n.x-r} ${n.y-r} ${n.width+2*r} ${n.height+2*r}`;t.attr("viewBox",l)},"setupGraphViewbox"),to={},CA=m((e,t,r)=>{let i="";return e in to&&to[e]?i=to[e](r):rt.warn(`No theme found for ${e}`),` & {
|
|
80
|
+
font-family: ${r.fontFamily};
|
|
81
|
+
font-size: ${r.fontSize};
|
|
82
|
+
fill: ${r.textColor}
|
|
83
|
+
}
|
|
84
|
+
@keyframes edge-animation-frame {
|
|
85
|
+
from {
|
|
86
|
+
stroke-dashoffset: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
@keyframes dash {
|
|
90
|
+
to {
|
|
91
|
+
stroke-dashoffset: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
& .edge-animation-slow {
|
|
95
|
+
stroke-dasharray: 9,5 !important;
|
|
96
|
+
stroke-dashoffset: 900;
|
|
97
|
+
animation: dash 50s linear infinite;
|
|
98
|
+
stroke-linecap: round;
|
|
99
|
+
}
|
|
100
|
+
& .edge-animation-fast {
|
|
101
|
+
stroke-dasharray: 9,5 !important;
|
|
102
|
+
stroke-dashoffset: 900;
|
|
103
|
+
animation: dash 20s linear infinite;
|
|
104
|
+
stroke-linecap: round;
|
|
105
|
+
}
|
|
106
|
+
/* Classes common for multiple diagrams */
|
|
107
|
+
|
|
108
|
+
& .error-icon {
|
|
109
|
+
fill: ${r.errorBkgColor};
|
|
110
|
+
}
|
|
111
|
+
& .error-text {
|
|
112
|
+
fill: ${r.errorTextColor};
|
|
113
|
+
stroke: ${r.errorTextColor};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
& .edge-thickness-normal {
|
|
117
|
+
stroke-width: 1px;
|
|
118
|
+
}
|
|
119
|
+
& .edge-thickness-thick {
|
|
120
|
+
stroke-width: 3.5px
|
|
121
|
+
}
|
|
122
|
+
& .edge-pattern-solid {
|
|
123
|
+
stroke-dasharray: 0;
|
|
124
|
+
}
|
|
125
|
+
& .edge-thickness-invisible {
|
|
126
|
+
stroke-width: 0;
|
|
127
|
+
fill: none;
|
|
128
|
+
}
|
|
129
|
+
& .edge-pattern-dashed{
|
|
130
|
+
stroke-dasharray: 3;
|
|
131
|
+
}
|
|
132
|
+
.edge-pattern-dotted {
|
|
133
|
+
stroke-dasharray: 2;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
& .marker {
|
|
137
|
+
fill: ${r.lineColor};
|
|
138
|
+
stroke: ${r.lineColor};
|
|
139
|
+
}
|
|
140
|
+
& .marker.cross {
|
|
141
|
+
stroke: ${r.lineColor};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
& svg {
|
|
145
|
+
font-family: ${r.fontFamily};
|
|
146
|
+
font-size: ${r.fontSize};
|
|
147
|
+
}
|
|
148
|
+
& p {
|
|
149
|
+
margin: 0
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
${i}
|
|
153
|
+
|
|
154
|
+
${t}
|
|
155
|
+
`},"getStyles"),SA=m((e,t)=>{t!==void 0&&(to[e]=t)},"addStylesForDiagram"),TA=CA,vm={};pE(vm,{clear:()=>EA,getAccDescription:()=>BA,getAccTitle:()=>MA,getDiagramTitle:()=>RA,setAccDescription:()=>LA,setAccTitle:()=>AA,setDiagramTitle:()=>$A});var Zh="",Kh="",Qh="",Jh=m(e=>Hr(e,gr()),"sanitizeText"),EA=m(()=>{Zh="",Qh="",Kh=""},"clear"),AA=m(e=>{Zh=Jh(e).replace(/^\s+/g,"")},"setAccTitle"),MA=m(()=>Zh,"getAccTitle"),LA=m(e=>{Qh=Jh(e).replace(/\n\s+/g,`
|
|
156
|
+
`)},"setAccDescription"),BA=m(()=>Qh,"getAccDescription"),$A=m(e=>{Kh=Jh(e)},"setDiagramTitle"),RA=m(()=>Kh,"getDiagramTitle"),Jd=rt,OA=Yh,Re=gr,AD=fm,MD=Jn,tu=m(e=>Hr(e,Re()),"sanitizeText"),NA=wA,IA=m(()=>vm,"getCommonDb"),Mo={},Lo=m((e,t,r)=>{var i;Mo[e]&&Jd.warn(`Diagram with id ${e} already registered. Overwriting.`),Mo[e]=t,r&&lm(e,r),SA(e,t.styles),(i=t.injectUtils)==null||i.call(t,Jd,OA,Re,tu,NA,IA(),()=>{})},"registerDiagram"),Oc=m(e=>{if(e in Mo)return Mo[e];throw new DA(e)},"getDiagram"),Gn,DA=(Gn=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},m(Gn,"DiagramNotFoundError"),Gn),FA=m(e=>{var n;const{securityLevel:t}=Re();let r=se("body");if(t==="sandbox"){const o=((n=se(`#i${e}`).node())==null?void 0:n.contentDocument)??document;r=se(o.body)}return r.select(`#${e}`)},"selectSvgElement");function eu(e){return typeof e>"u"||e===null}m(eu,"isNothing");function _m(e){return typeof e=="object"&&e!==null}m(_m,"isObject");function km(e){return Array.isArray(e)?e:eu(e)?[]:[e]}m(km,"toArray");function wm(e,t){var r,i,n,a;if(t)for(a=Object.keys(t),r=0,i=a.length;r<i;r+=1)n=a[r],e[n]=t[n];return e}m(wm,"extend");function Cm(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}m(Cm,"repeat");function Sm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}m(Sm,"isNegativeZero");var PA=eu,zA=_m,WA=km,qA=Cm,HA=Sm,jA=wm,rr={isNothing:PA,isObject:zA,toArray:WA,repeat:qA,isNegativeZero:HA,extend:jA};function ru(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
157
|
+
|
|
158
|
+
`+e.mark.snippet),i+" "+r):i}m(ru,"formatError");function ea(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=ru(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}m(ea,"YAMLException$1");ea.prototype=Object.create(Error.prototype);ea.prototype.constructor=ea;ea.prototype.toString=m(function(t){return this.name+": "+ru(this,t)},"toString");var Lr=ea;function eo(e,t,r,i,n){var a="",o="",s=Math.floor(n/2)-1;return i-t>s&&(a=" ... ",t=i-s+a.length),r-i>s&&(o=" ...",r=i+s-o.length),{str:a+e.slice(t,r).replace(/\t/g,"→")+o,pos:i-t+a.length}}m(eo,"getLine");function ro(e,t){return rr.repeat(" ",t-e.length)+e}m(ro,"padStart");function Tm(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],n=[],a,o=-1;a=r.exec(e.buffer);)n.push(a.index),i.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s="",c,l,h=Math.min(e.line+t.linesAfter,n.length).toString().length,u=t.maxLength-(t.indent+h+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=eo(e.buffer,i[o-c],n[o-c],e.position-(i[o]-i[o-c]),u),s=rr.repeat(" ",t.indent)+ro((e.line-c+1).toString(),h)+" | "+l.str+`
|
|
159
|
+
`+s;for(l=eo(e.buffer,i[o],n[o],e.position,u),s+=rr.repeat(" ",t.indent)+ro((e.line+1).toString(),h)+" | "+l.str+`
|
|
160
|
+
`,s+=rr.repeat("-",t.indent+h+3+l.pos)+`^
|
|
161
|
+
`,c=1;c<=t.linesAfter&&!(o+c>=n.length);c++)l=eo(e.buffer,i[o+c],n[o+c],e.position-(i[o]-i[o+c]),u),s+=rr.repeat(" ",t.indent)+ro((e.line+c+1).toString(),h)+" | "+l.str+`
|
|
162
|
+
`;return s.replace(/\n$/,"")}m(Tm,"makeSnippet");var UA=Tm,GA=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],YA=["scalar","sequence","mapping"];function Em(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}m(Em,"compileStyleAliases");function Am(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(GA.indexOf(r)===-1)throw new Lr('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Em(t.styleAliases||null),YA.indexOf(this.kind)===-1)throw new Lr('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}m(Am,"Type$1");var mr=Am;function Nc(e,t){var r=[];return e[t].forEach(function(i){var n=r.length;r.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&a.multi===i.multi&&(n=o)}),r[n]=i}),r}m(Nc,"compileList");function Mm(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(m(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}m(Mm,"compileMap");function Bo(e){return this.extend(e)}m(Bo,"Schema$1");Bo.prototype.extend=m(function(t){var r=[],i=[];if(t instanceof mr)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new Lr("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof mr))throw new Lr("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Lr("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Lr("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(a){if(!(a instanceof mr))throw new Lr("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(Bo.prototype);return n.implicit=(this.implicit||[]).concat(r),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=Nc(n,"implicit"),n.compiledExplicit=Nc(n,"explicit"),n.compiledTypeMap=Mm(n.compiledImplicit,n.compiledExplicit),n},"extend");var VA=Bo,XA=new mr("tag:yaml.org,2002:str",{kind:"scalar",construct:m(function(e){return e!==null?e:""},"construct")}),ZA=new mr("tag:yaml.org,2002:seq",{kind:"sequence",construct:m(function(e){return e!==null?e:[]},"construct")}),KA=new mr("tag:yaml.org,2002:map",{kind:"mapping",construct:m(function(e){return e!==null?e:{}},"construct")}),QA=new VA({explicit:[XA,ZA,KA]});function Lm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}m(Lm,"resolveYamlNull");function Bm(){return null}m(Bm,"constructYamlNull");function $m(e){return e===null}m($m,"isNull");var JA=new mr("tag:yaml.org,2002:null",{kind:"scalar",resolve:Lm,construct:Bm,predicate:$m,represent:{canonical:m(function(){return"~"},"canonical"),lowercase:m(function(){return"null"},"lowercase"),uppercase:m(function(){return"NULL"},"uppercase"),camelcase:m(function(){return"Null"},"camelcase"),empty:m(function(){return""},"empty")},defaultStyle:"lowercase"});function Rm(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}m(Rm,"resolveYamlBoolean");function Om(e){return e==="true"||e==="True"||e==="TRUE"}m(Om,"constructYamlBoolean");function Nm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}m(Nm,"isBoolean");var tM=new mr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Rm,construct:Om,predicate:Nm,represent:{lowercase:m(function(e){return e?"true":"false"},"lowercase"),uppercase:m(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:m(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Im(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}m(Im,"isHexCode");function Dm(e){return 48<=e&&e<=55}m(Dm,"isOctCode");function Fm(e){return 48<=e&&e<=57}m(Fm,"isDecCode");function Pm(e){if(e===null)return!1;var t=e.length,r=0,i=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;i=!0}return i&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Im(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Dm(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!Fm(e.charCodeAt(r)))return!1;i=!0}return!(!i||n==="_")}m(Pm,"resolveYamlInteger");function zm(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}m(zm,"constructYamlInteger");function Wm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!rr.isNegativeZero(e)}m(Wm,"isInteger");var eM=new mr("tag:yaml.org,2002:int",{kind:"scalar",resolve:Pm,construct:zm,predicate:Wm,represent:{binary:m(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:m(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:m(function(e){return e.toString(10)},"decimal"),hexadecimal:m(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),rM=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qm(e){return!(e===null||!rM.test(e)||e[e.length-1]==="_")}m(qm,"resolveYamlFloat");function Hm(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}m(Hm,"constructYamlFloat");var iM=/^[-+]?[0-9]+e/;function jm(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(rr.isNegativeZero(e))return"-0.0";return r=e.toString(10),iM.test(r)?r.replace("e",".e"):r}m(jm,"representYamlFloat");function Um(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||rr.isNegativeZero(e))}m(Um,"isFloat");var nM=new mr("tag:yaml.org,2002:float",{kind:"scalar",resolve:qm,construct:Hm,predicate:Um,represent:jm,defaultStyle:"lowercase"}),Gm=QA.extend({implicit:[JA,tM,eM,nM]}),aM=Gm,Ym=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Vm=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Xm(e){return e===null?!1:Ym.exec(e)!==null||Vm.exec(e)!==null}m(Xm,"resolveYamlTimestamp");function Zm(e){var t,r,i,n,a,o,s,c=0,l=null,h,u,f;if(t=Ym.exec(e),t===null&&(t=Vm.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,i,n));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(h=+t[10],u=+(t[11]||0),l=(h*60+u)*6e4,t[9]==="-"&&(l=-l)),f=new Date(Date.UTC(r,i,n,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}m(Zm,"constructYamlTimestamp");function Km(e){return e.toISOString()}m(Km,"representYamlTimestamp");var sM=new mr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xm,construct:Zm,instanceOf:Date,represent:Km});function Qm(e){return e==="<<"||e===null}m(Qm,"resolveYamlMerge");var oM=new mr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Qm}),iu=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
163
|
+
\r`;function Jm(e){if(e===null)return!1;var t,r,i=0,n=e.length,a=iu;for(r=0;r<n;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}m(Jm,"resolveYamlBinary");function t0(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,a=iu,o=0,s=[];for(t=0;t<n;t++)t%4===0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(i.charAt(t));return r=n%4*6,r===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):r===18?(s.push(o>>10&255),s.push(o>>2&255)):r===12&&s.push(o>>4&255),new Uint8Array(s)}m(t0,"constructYamlBinary");function e0(e){var t="",r=0,i,n,a=e.length,o=iu;for(i=0;i<a;i++)i%3===0&&i&&(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]),r=(r<<8)+e[i];return n=a%3,n===0?(t+=o[r>>18&63],t+=o[r>>12&63],t+=o[r>>6&63],t+=o[r&63]):n===2?(t+=o[r>>10&63],t+=o[r>>4&63],t+=o[r<<2&63],t+=o[64]):n===1&&(t+=o[r>>2&63],t+=o[r<<4&63],t+=o[64],t+=o[64]),t}m(e0,"representYamlBinary");function r0(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}m(r0,"isBinary");var lM=new mr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Jm,construct:t0,predicate:r0,represent:e0}),cM=Object.prototype.hasOwnProperty,hM=Object.prototype.toString;function i0(e){if(e===null)return!0;var t=[],r,i,n,a,o,s=e;for(r=0,i=s.length;r<i;r+=1){if(n=s[r],o=!1,hM.call(n)!=="[object Object]")return!1;for(a in n)if(cM.call(n,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}m(i0,"resolveYamlOmap");function n0(e){return e!==null?e:[]}m(n0,"constructYamlOmap");var uM=new mr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i0,construct:n0}),dM=Object.prototype.toString;function a0(e){if(e===null)return!0;var t,r,i,n,a,o=e;for(a=new Array(o.length),t=0,r=o.length;t<r;t+=1){if(i=o[t],dM.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;a[t]=[n[0],i[n[0]]]}return!0}m(a0,"resolveYamlPairs");function s0(e){if(e===null)return[];var t,r,i,n,a,o=e;for(a=new Array(o.length),t=0,r=o.length;t<r;t+=1)i=o[t],n=Object.keys(i),a[t]=[n[0],i[n[0]]];return a}m(s0,"constructYamlPairs");var fM=new mr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:a0,construct:s0}),pM=Object.prototype.hasOwnProperty;function o0(e){if(e===null)return!0;var t,r=e;for(t in r)if(pM.call(r,t)&&r[t]!==null)return!1;return!0}m(o0,"resolveYamlSet");function l0(e){return e!==null?e:{}}m(l0,"constructYamlSet");var gM=new mr("tag:yaml.org,2002:set",{kind:"mapping",resolve:o0,construct:l0}),c0=aM.extend({implicit:[sM,oM],explicit:[lM,uM,fM,gM]}),Wi=Object.prototype.hasOwnProperty,$o=1,h0=2,u0=3,Ro=4,Ql=1,mM=2,tf=3,bM=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,yM=/[\x85\u2028\u2029]/,xM=/[,\[\]\{\}]/,d0=/^(?:!|!!|![a-z\-]+!)$/i,f0=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ic(e){return Object.prototype.toString.call(e)}m(Ic,"_class");function ti(e){return e===10||e===13}m(ti,"is_EOL");function Pi(e){return e===9||e===32}m(Pi,"is_WHITE_SPACE");function kr(e){return e===9||e===32||e===10||e===13}m(kr,"is_WS_OR_EOL");function ln(e){return e===44||e===91||e===93||e===123||e===125}m(ln,"is_FLOW_INDICATOR");function p0(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}m(p0,"fromHexCode");function g0(e){return e===120?2:e===117?4:e===85?8:0}m(g0,"escapedHexLen");function m0(e){return 48<=e&&e<=57?e-48:-1}m(m0,"fromDecimalCode");function Dc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
164
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}m(Dc,"simpleEscapeSequence");function b0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}m(b0,"charFromCodepoint");var y0=new Array(256),x0=new Array(256);for(Qi=0;Qi<256;Qi++)y0[Qi]=Dc(Qi)?1:0,x0[Qi]=Dc(Qi);var Qi;function v0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||c0,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}m(v0,"State$1");function nu(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=UA(r),new Lr(t,r)}m(nu,"generateError");function qt(e,t){throw nu(e,t)}m(qt,"throwError");function rs(e,t){e.onWarning&&e.onWarning.call(null,nu(e,t))}m(rs,"throwWarning");var ef={YAML:m(function(t,r,i){var n,a,o;t.version!==null&&qt(t,"duplication of %YAML directive"),i.length!==1&&qt(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&qt(t,"ill-formed argument of the YAML directive"),a=parseInt(n[1],10),o=parseInt(n[2],10),a!==1&&qt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&rs(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:m(function(t,r,i){var n,a;i.length!==2&&qt(t,"TAG directive accepts exactly two arguments"),n=i[0],a=i[1],d0.test(n)||qt(t,"ill-formed tag handle (first argument) of the TAG directive"),Wi.call(t.tagMap,n)&&qt(t,'there is a previously declared suffix for "'+n+'" tag handle'),f0.test(a)||qt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{qt(t,"tag prefix is malformed: "+a)}t.tagMap[n]=a},"handleTagDirective")};function Ai(e,t,r,i){var n,a,o,s;if(t<r){if(s=e.input.slice(t,r),i)for(n=0,a=s.length;n<a;n+=1)o=s.charCodeAt(n),o===9||32<=o&&o<=1114111||qt(e,"expected valid JSON character");else bM.test(s)&&qt(e,"the stream contains non-printable characters");e.result+=s}}m(Ai,"captureSegment");function Fc(e,t,r,i){var n,a,o,s;for(rr.isObject(r)||qt(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),o=0,s=n.length;o<s;o+=1)a=n[o],Wi.call(t,a)||(t[a]=r[a],i[a]=!0)}m(Fc,"mergeMappings");function cn(e,t,r,i,n,a,o,s,c){var l,h;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),l=0,h=n.length;l<h;l+=1)Array.isArray(n[l])&&qt(e,"nested arrays are not supported inside keys"),typeof n=="object"&&Ic(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&Ic(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(l=0,h=a.length;l<h;l+=1)Fc(e,t,a[l],r);else Fc(e,t,a,r);else!e.json&&!Wi.call(r,n)&&Wi.call(t,n)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,qt(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,writable:!0,value:a}):t[n]=a,delete r[n];return t}m(cn,"storeMappingPair");function dl(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):qt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}m(dl,"readLineBreak");function Xe(e,t,r){for(var i=0,n=e.input.charCodeAt(e.position);n!==0;){for(;Pi(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ti(n))for(dl(e),n=e.input.charCodeAt(e.position),i++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&rs(e,"deficient indentation"),i}m(Xe,"skipSeparationSpace");function ms(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||kr(r)))}m(ms,"testDocumentSeparator");function fl(e,t){t===1?e.result+=" ":t>1&&(e.result+=rr.repeat(`
|
|
165
|
+
`,t-1))}m(fl,"writeFoldedLines");function _0(e,t,r){var i,n,a,o,s,c,l,h,u=e.kind,f=e.result,d;if(d=e.input.charCodeAt(e.position),kr(d)||ln(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(n=e.input.charCodeAt(e.position+1),kr(n)||r&&ln(n)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(n=e.input.charCodeAt(e.position+1),kr(n)||r&&ln(n))break}else if(d===35){if(i=e.input.charCodeAt(e.position-1),kr(i))break}else{if(e.position===e.lineStart&&ms(e)||r&&ln(d))break;if(ti(d))if(c=e.line,l=e.lineStart,h=e.lineIndent,Xe(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=h;break}}s&&(Ai(e,a,o,!1),fl(e,e.line-c),a=o=e.position,s=!1),Pi(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return Ai(e,a,o,!1),e.result?!0:(e.kind=u,e.result=f,!1)}m(_0,"readPlainScalar");function k0(e,t){var r,i,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Ai(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,n=e.position;else return!0;else ti(r)?(Ai(e,i,n,!0),fl(e,Xe(e,!1,t)),i=n=e.position):e.position===e.lineStart&&ms(e)?qt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);qt(e,"unexpected end of the stream within a single quoted scalar")}m(k0,"readSingleQuotedScalar");function w0(e,t){var r,i,n,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return Ai(e,r,e.position,!0),e.position++,!0;if(s===92){if(Ai(e,r,e.position,!0),s=e.input.charCodeAt(++e.position),ti(s))Xe(e,!1,t);else if(s<256&&y0[s])e.result+=x0[s],e.position++;else if((o=g0(s))>0){for(n=o,a=0;n>0;n--)s=e.input.charCodeAt(++e.position),(o=p0(s))>=0?a=(a<<4)+o:qt(e,"expected hexadecimal character");e.result+=b0(a),e.position++}else qt(e,"unknown escape sequence");r=i=e.position}else ti(s)?(Ai(e,r,i,!0),fl(e,Xe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&ms(e)?qt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}qt(e,"unexpected end of the stream within a double quoted scalar")}m(w0,"readDoubleQuotedScalar");function C0(e,t){var r=!0,i,n,a,o=e.tag,s,c=e.anchor,l,h,u,f,d,p=Object.create(null),g,b,y,x;if(x=e.input.charCodeAt(e.position),x===91)h=93,d=!1,s=[];else if(x===123)h=125,d=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),x=e.input.charCodeAt(++e.position);x!==0;){if(Xe(e,!0,t),x=e.input.charCodeAt(e.position),x===h)return e.position++,e.tag=o,e.anchor=c,e.kind=d?"mapping":"sequence",e.result=s,!0;r?x===44&&qt(e,"expected the node content, but found ','"):qt(e,"missed comma between flow collection entries"),b=g=y=null,u=f=!1,x===63&&(l=e.input.charCodeAt(e.position+1),kr(l)&&(u=f=!0,e.position++,Xe(e,!0,t))),i=e.line,n=e.lineStart,a=e.position,yn(e,t,$o,!1,!0),b=e.tag,g=e.result,Xe(e,!0,t),x=e.input.charCodeAt(e.position),(f||e.line===i)&&x===58&&(u=!0,x=e.input.charCodeAt(++e.position),Xe(e,!0,t),yn(e,t,$o,!1,!0),y=e.result),d?cn(e,s,p,b,g,y,i,n,a):u?s.push(cn(e,null,p,b,g,y,i,n,a)):s.push(g),Xe(e,!0,t),x=e.input.charCodeAt(e.position),x===44?(r=!0,x=e.input.charCodeAt(++e.position)):r=!1}qt(e,"unexpected end of the stream within a flow collection")}m(C0,"readFlowCollection");function S0(e,t){var r,i,n=Ql,a=!1,o=!1,s=t,c=0,l=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)i=!1;else if(u===62)i=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Ql===n?n=u===43?tf:mM:qt(e,"repeat of a chomping mode identifier");else if((h=m0(u))>=0)h===0?qt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?qt(e,"repeat of an indentation width identifier"):(s=t+h-1,o=!0);else break;if(Pi(u)){do u=e.input.charCodeAt(++e.position);while(Pi(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ti(u)&&u!==0)}for(;u!==0;){for(dl(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),ti(u)){c++;continue}if(e.lineIndent<s){n===tf?e.result+=rr.repeat(`
|
|
166
|
+
`,a?1+c:c):n===Ql&&a&&(e.result+=`
|
|
167
|
+
`);break}for(i?Pi(u)?(l=!0,e.result+=rr.repeat(`
|
|
168
|
+
`,a?1+c:c)):l?(l=!1,e.result+=rr.repeat(`
|
|
169
|
+
`,c+1)):c===0?a&&(e.result+=" "):e.result+=rr.repeat(`
|
|
170
|
+
`,c):e.result+=rr.repeat(`
|
|
171
|
+
`,a?1+c:c),a=!0,o=!0,c=0,r=e.position;!ti(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Ai(e,r,e.position,!1)}return!0}m(S0,"readBlockScalar");function Pc(e,t){var r,i=e.tag,n=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,qt(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!kr(o))));){if(s=!0,e.position++,Xe(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,yn(e,t,u0,!1,!0),a.push(e.result),Xe(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)qt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=i,e.anchor=n,e.kind="sequence",e.result=a,!0):!1}m(Pc,"readBlockSequence");function T0(e,t,r){var i,n,a,o,s,c,l=e.tag,h=e.anchor,u={},f=Object.create(null),d=null,p=null,g=null,b=!1,y=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),x=e.input.charCodeAt(e.position);x!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,qt(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),a=e.line,(x===63||x===58)&&kr(i))x===63?(b&&(cn(e,u,f,d,p,null,o,s,c),d=p=g=null),y=!0,b=!0,n=!0):b?(b=!1,n=!0):qt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=i;else{if(o=e.line,s=e.lineStart,c=e.position,!yn(e,r,h0,!1,!0))break;if(e.line===a){for(x=e.input.charCodeAt(e.position);Pi(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),kr(x)||qt(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(cn(e,u,f,d,p,null,o,s,c),d=p=g=null),y=!0,b=!1,n=!1,d=e.tag,p=e.result;else if(y)qt(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=l,e.anchor=h,!0}else if(y)qt(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=l,e.anchor=h,!0}if((e.line===a||e.lineIndent>t)&&(b&&(o=e.line,s=e.lineStart,c=e.position),yn(e,t,Ro,!0,n)&&(b?p=e.result:g=e.result),b||(cn(e,u,f,d,p,g,o,s,c),d=p=g=null),Xe(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&x!==0)qt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&cn(e,u,f,d,p,null,o,s,c),y&&(e.tag=l,e.anchor=h,e.kind="mapping",e.result=u),y}m(T0,"readBlockMapping");function E0(e){var t,r=!1,i=!1,n,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&qt(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(r=!0,o=e.input.charCodeAt(++e.position)):o===33?(i=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):qt(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!kr(o);)o===33&&(i?qt(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),d0.test(n)||qt(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),xM.test(a)&&qt(e,"tag suffix cannot contain flow indicator characters")}a&&!f0.test(a)&&qt(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{qt(e,"tag name is malformed: "+a)}return r?e.tag=a:Wi.call(e.tagMap,n)?e.tag=e.tagMap[n]+a:n==="!"?e.tag="!"+a:n==="!!"?e.tag="tag:yaml.org,2002:"+a:qt(e,'undeclared tag handle "'+n+'"'),!0}m(E0,"readTagProperty");function A0(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&qt(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!kr(r)&&!ln(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&qt(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}m(A0,"readAnchorProperty");function M0(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!kr(i)&&!ln(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&qt(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Wi.call(e.anchorMap,r)||qt(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Xe(e,!0,-1),!0}m(M0,"readAlias");function yn(e,t,r,i,n){var a,o,s,c=1,l=!1,h=!1,u,f,d,p,g,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Ro===r||u0===r,i&&Xe(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;E0(e)||A0(e);)Xe(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&(s=l||n),(c===1||Ro===r)&&($o===r||h0===r?g=t:g=t+1,b=e.position-e.lineStart,c===1?s&&(Pc(e,b)||T0(e,b,g))||C0(e,g)?h=!0:(o&&S0(e,g)||k0(e,g)||w0(e,g)?h=!0:M0(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&qt(e,"alias node should not have any properties")):_0(e,g,$o===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(h=s&&Pc(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&qt(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(p=e.implicitTypes[u],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Wi.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,d=e.typeMap.multi[e.kind||"fallback"],u=0,f=d.length;u<f;u+=1)if(e.tag.slice(0,d[u].tag.length)===d[u].tag){p=d[u];break}p||qt(e,"unknown tag !<"+e.tag+">"),e.result!==null&&p.kind!==e.kind&&qt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):qt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}m(yn,"composeNode");function L0(e){var t=e.position,r,i,n,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(Xe(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),r=e.position;o!==0&&!kr(o);)o=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),n=[],i.length<1&&qt(e,"directive name must not be less than one character in length");o!==0;){for(;Pi(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!ti(o));break}if(ti(o))break;for(r=e.position;o!==0&&!kr(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}o!==0&&dl(e),Wi.call(ef,i)?ef[i](e,i,n):rs(e,'unknown document directive "'+i+'"')}if(Xe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Xe(e,!0,-1)):a&&qt(e,"directives end mark is expected"),yn(e,e.lineIndent-1,Ro,!1,!0),Xe(e,!0,-1),e.checkLineBreaks&&yM.test(e.input.slice(t,e.position))&&rs(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ms(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Xe(e,!0,-1));return}if(e.position<e.length-1)qt(e,"end of the stream or a document separator is expected");else return}m(L0,"readDocument");function au(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
172
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new v0(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,qt(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)L0(r);return r.documents}m(au,"loadDocuments");function vM(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=au(e,r);if(typeof t!="function")return i;for(var n=0,a=i.length;n<a;n+=1)t(i[n])}m(vM,"loadAll$1");function B0(e,t){var r=au(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Lr("expected a single document in the stream, but found more")}}m(B0,"load$1");var _M=B0,kM={load:_M},$0=Object.prototype.toString,R0=Object.prototype.hasOwnProperty,su=65279,wM=9,is=10,CM=13,SM=32,TM=33,EM=34,zc=35,AM=37,MM=38,LM=39,BM=42,O0=44,$M=45,Oo=58,RM=61,OM=62,NM=63,IM=64,N0=91,I0=93,DM=96,D0=123,FM=124,F0=125,yr={};yr[0]="\\0";yr[7]="\\a";yr[8]="\\b";yr[9]="\\t";yr[10]="\\n";yr[11]="\\v";yr[12]="\\f";yr[13]="\\r";yr[27]="\\e";yr[34]='\\"';yr[92]="\\\\";yr[133]="\\N";yr[160]="\\_";yr[8232]="\\L";yr[8233]="\\P";var PM=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],zM=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function P0(e,t){var r,i,n,a,o,s,c;if(t===null)return{};for(r={},i=Object.keys(t),n=0,a=i.length;n<a;n+=1)o=i[n],s=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&R0.call(c.styleAliases,s)&&(s=c.styleAliases[s]),r[o]=s;return r}m(P0,"compileStyleMap");function z0(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Lr("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+rr.repeat("0",i-t.length)+t}m(z0,"encodeHex");var WM=1,ns=2;function W0(e){this.schema=e.schema||c0,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=rr.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=P0(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ns:WM,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}m(W0,"State");function Wc(e,t){for(var r=rr.repeat(" ",t),i=0,n=-1,a="",o,s=e.length;i<s;)n=e.indexOf(`
|
|
173
|
+
`,i),n===-1?(o=e.slice(i),i=s):(o=e.slice(i,n+1),i=n+1),o.length&&o!==`
|
|
174
|
+
`&&(a+=r),a+=o;return a}m(Wc,"indentString");function No(e,t){return`
|
|
175
|
+
`+rr.repeat(" ",e.indent*t)}m(No,"generateNextLine");function q0(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}m(q0,"testImplicitResolving");function as(e){return e===SM||e===wM}m(as,"isWhitespace");function ra(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==su||65536<=e&&e<=1114111}m(ra,"isPrintable");function qc(e){return ra(e)&&e!==su&&e!==CM&&e!==is}m(qc,"isNsCharOrWhitespace");function Hc(e,t,r){var i=qc(e),n=i&&!as(e);return(r?i:i&&e!==O0&&e!==N0&&e!==I0&&e!==D0&&e!==F0)&&e!==zc&&!(t===Oo&&!n)||qc(t)&&!as(t)&&e===zc||t===Oo&&n}m(Hc,"isPlainSafe");function H0(e){return ra(e)&&e!==su&&!as(e)&&e!==$M&&e!==NM&&e!==Oo&&e!==O0&&e!==N0&&e!==I0&&e!==D0&&e!==F0&&e!==zc&&e!==MM&&e!==BM&&e!==TM&&e!==FM&&e!==RM&&e!==OM&&e!==LM&&e!==EM&&e!==AM&&e!==IM&&e!==DM}m(H0,"isPlainSafeFirst");function j0(e){return!as(e)&&e!==Oo}m(j0,"isPlainSafeLast");function On(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}m(On,"codePointAt");function ou(e){var t=/^\n* /;return t.test(e)}m(ou,"needIndentIndicator");var U0=1,jc=2,G0=3,Y0=4,Ln=5;function V0(e,t,r,i,n,a,o,s){var c,l=0,h=null,u=!1,f=!1,d=i!==-1,p=-1,g=H0(On(e,0))&&j0(On(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=On(e,c),!ra(l))return Ln;g=g&&Hc(l,h,s),h=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=On(e,c),l===is)u=!0,d&&(f=f||c-p-1>i&&e[p+1]!==" ",p=c);else if(!ra(l))return Ln;g=g&&Hc(l,h,s),h=l}f=f||d&&c-p-1>i&&e[p+1]!==" "}return!u&&!f?g&&!o&&!n(e)?U0:a===ns?Ln:jc:r>9&&ou(e)?Ln:o?a===ns?Ln:jc:f?Y0:G0}m(V0,"chooseScalarStyle");function X0(e,t,r,i,n){e.dump=(function(){if(t.length===0)return e.quotingType===ns?'""':"''";if(!e.noCompatMode&&(PM.indexOf(t)!==-1||zM.test(t)))return e.quotingType===ns?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,r),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=i||e.flowLevel>-1&&r>=e.flowLevel;function c(l){return q0(e,l)}switch(m(c,"testAmbiguity"),V0(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!i,n)){case U0:return t;case jc:return"'"+t.replace(/'/g,"''")+"'";case G0:return"|"+Uc(t,e.indent)+Gc(Wc(t,a));case Y0:return">"+Uc(t,e.indent)+Gc(Wc(Z0(t,o),a));case Ln:return'"'+K0(t)+'"';default:throw new Lr("impossible error: invalid scalar style")}})()}m(X0,"writeScalar");function Uc(e,t){var r=ou(e)?String(t):"",i=e[e.length-1]===`
|
|
176
|
+
`,n=i&&(e[e.length-2]===`
|
|
177
|
+
`||e===`
|
|
178
|
+
`),a=n?"+":i?"":"-";return r+a+`
|
|
179
|
+
`}m(Uc,"blockHeader");function Gc(e){return e[e.length-1]===`
|
|
180
|
+
`?e.slice(0,-1):e}m(Gc,"dropEndingNewline");function Z0(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var l=e.indexOf(`
|
|
181
|
+
`);return l=l!==-1?l:e.length,r.lastIndex=l,Yc(e.slice(0,l),t)})(),n=e[0]===`
|
|
182
|
+
`||e[0]===" ",a,o;o=r.exec(e);){var s=o[1],c=o[2];a=c[0]===" ",i+=s+(!n&&!a&&c!==""?`
|
|
183
|
+
`:"")+Yc(c,t),n=a}return i}m(Z0,"foldString");function Yc(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,n=0,a,o=0,s=0,c="";i=r.exec(e);)s=i.index,s-n>t&&(a=o>n?o:s,c+=`
|
|
184
|
+
`+e.slice(n,a),n=a+1),o=s;return c+=`
|
|
185
|
+
`,e.length-n>t&&o>n?c+=e.slice(n,o)+`
|
|
186
|
+
`+e.slice(o+1):c+=e.slice(n),c.slice(1)}m(Yc,"foldLine");function K0(e){for(var t="",r=0,i,n=0;n<e.length;r>=65536?n+=2:n++)r=On(e,n),i=yr[r],!i&&ra(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=i||z0(r);return t}m(K0,"escapeString");function Q0(e,t,r){var i="",n=e.tag,a,o,s;for(a=0,o=r.length;a<o;a+=1)s=r[a],e.replacer&&(s=e.replacer.call(r,String(a),s)),(gi(e,t,s,!1,!1)||typeof s>"u"&&gi(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=n,e.dump="["+i+"]"}m(Q0,"writeFlowSequence");function Vc(e,t,r,i){var n="",a=e.tag,o,s,c;for(o=0,s=r.length;o<s;o+=1)c=r[o],e.replacer&&(c=e.replacer.call(r,String(o),c)),(gi(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&gi(e,t+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=No(e,t)),e.dump&&is===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=a,e.dump=n||"[]"}m(Vc,"writeBlockSequence");function J0(e,t,r){var i="",n=e.tag,a=Object.keys(r),o,s,c,l,h;for(o=0,s=a.length;o<s;o+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),c=a[o],l=r[c],e.replacer&&(l=e.replacer.call(r,c,l)),gi(e,t,c,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),gi(e,t,l,!1,!1)&&(h+=e.dump,i+=h));e.tag=n,e.dump="{"+i+"}"}m(J0,"writeFlowMapping");function tb(e,t,r,i){var n="",a=e.tag,o=Object.keys(r),s,c,l,h,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Lr("sortKeys must be a boolean or a function");for(s=0,c=o.length;s<c;s+=1)f="",(!i||n!=="")&&(f+=No(e,t)),l=o[s],h=r[l],e.replacer&&(h=e.replacer.call(r,l,h)),gi(e,t+1,l,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&is===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=No(e,t)),gi(e,t+1,h,!0,u)&&(e.dump&&is===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=a,e.dump=n||"{}"}m(tb,"writeBlockMapping");function Xc(e,t,r){var i,n,a,o,s,c;for(n=r?e.explicitTypes:e.implicitTypes,a=0,o=n.length;a<o;a+=1)if(s=n[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(r?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,$0.call(s.represent)==="[object Function]")i=s.represent(t,c);else if(R0.call(s.represent,c))i=s.represent[c](t,c);else throw new Lr("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=i}return!0}return!1}m(Xc,"detectType");function gi(e,t,r,i,n,a,o){e.tag=null,e.dump=r,Xc(e,r,!1)||Xc(e,r,!0);var s=$0.call(e.dump),c=i,l;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=s==="[object Object]"||s==="[object Array]",u,f;if(h&&(u=e.duplicates.indexOf(r),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")i&&Object.keys(e.dump).length!==0?(tb(e,t,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(J0(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Vc(e,t-1,e.dump,n):Vc(e,t,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Q0(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&X0(e,e.dump,t,a,c);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Lr("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(l=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",e.dump=l+" "+e.dump)}return!0}m(gi,"writeNode");function eb(e,t){var r=[],i=[],n,a;for(Io(e,r,i),n=0,a=i.length;n<a;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=new Array(a)}m(eb,"getDuplicateReferences");function Io(e,t,r){var i,n,a;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,a=e.length;n<a;n+=1)Io(e[n],t,r);else for(i=Object.keys(e),n=0,a=i.length;n<a;n+=1)Io(e[i[n]],t,r)}m(Io,"inspectNode");function qM(e,t){t=t||{};var r=new W0(t);r.noRefs||eb(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),gi(r,0,i,!0,!0)?r.dump+`
|
|
187
|
+
`:""}m(qM,"dump$1");function HM(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}m(HM,"renamed");var jM=Gm,UM=kM.load;/*! Bundled license information:
|
|
188
|
+
|
|
189
|
+
js-yaml/dist/js-yaml.mjs:
|
|
190
|
+
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
191
|
+
*/var pr={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},rf={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function Na(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=He(e),t=He(t);const[r,i]=[e.x,e.y],[n,a]=[t.x,t.y],o=n-r,s=a-i;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}m(Na,"calculateDeltaAndAngle");var He=m(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),GM=m(e=>({x:m(function(t,r,i){let n=0;const a=He(i[0]).x<He(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(pr,e.arrowTypeStart)){const{angle:d,deltaX:p}=Na(i[0],i[1]);n=pr[e.arrowTypeStart]*Math.cos(d)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(pr,e.arrowTypeEnd)){const{angle:d,deltaX:p}=Na(i[i.length-1],i[i.length-2]);n=pr[e.arrowTypeEnd]*Math.cos(d)*(p>=0?1:-1)}const o=Math.abs(He(t).x-He(i[i.length-1]).x),s=Math.abs(He(t).y-He(i[i.length-1]).y),c=Math.abs(He(t).x-He(i[0]).x),l=Math.abs(He(t).y-He(i[0]).y),h=pr[e.arrowTypeStart],u=pr[e.arrowTypeEnd],f=1;if(o<u&&o>0&&s<u){let d=u+f-o;d*=a==="right"?-1:1,n-=d}if(c<h&&c>0&&l<h){let d=h+f-c;d*=a==="right"?-1:1,n+=d}return He(t).x+n},"x"),y:m(function(t,r,i){let n=0;const a=He(i[0]).y<He(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(pr,e.arrowTypeStart)){const{angle:d,deltaY:p}=Na(i[0],i[1]);n=pr[e.arrowTypeStart]*Math.abs(Math.sin(d))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(pr,e.arrowTypeEnd)){const{angle:d,deltaY:p}=Na(i[i.length-1],i[i.length-2]);n=pr[e.arrowTypeEnd]*Math.abs(Math.sin(d))*(p>=0?1:-1)}const o=Math.abs(He(t).y-He(i[i.length-1]).y),s=Math.abs(He(t).x-He(i[i.length-1]).x),c=Math.abs(He(t).y-He(i[0]).y),l=Math.abs(He(t).x-He(i[0]).x),h=pr[e.arrowTypeStart],u=pr[e.arrowTypeEnd],f=1;if(o<u&&o>0&&s<u){let d=u+f-o;d*=a==="up"?-1:1,n-=d}if(c<h&&c>0&&l<h){let d=h+f-c;d*=a==="up"?-1:1,n+=d}return He(t).y+n},"y")}),"getLineFunctionsWithOffset"),lu=m(({flowchart:e})=>{var n,a;const t=((n=e==null?void 0:e.subGraphTitleMargin)==null?void 0:n.top)??0,r=((a=e==null?void 0:e.subGraphTitleMargin)==null?void 0:a.bottom)??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),YM=m(e=>{const{handDrawnSeed:t}=Re();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),oa=m(e=>{const t=VM([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),VM=m(e=>{const t=new Map;return e.forEach(r=>{const[i,n]=r.split(":");t.set(i.trim(),n==null?void 0:n.trim())}),t},"styles2Map"),rb=m(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Ot=m(e=>{const{stylesArray:t}=oa(e),r=[],i=[],n=[],a=[];return t.forEach(o=>{const s=o[0];rb(s)?r.push(o.join(":")+" !important"):(i.push(o.join(":")+" !important"),s.includes("stroke")&&n.push(o.join(":")+" !important"),s==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:n,backgroundStyles:a}},"styles2String"),Rt=m((e,t)=>{var c;const{themeVariables:r,handDrawnSeed:i}=Re(),{nodeBorder:n,mainBkg:a}=r,{stylesMap:o}=oa(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||n,seed:i,strokeWidth:((c=o.get("stroke-width"))==null?void 0:c.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:XM(o.get("stroke-dasharray"))},t)},"userNodeOverrides"),XM=m(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const n=isNaN(t[0])?0:t[0];return[n,n]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),ka={},tr={},nf;function ZM(){return nf||(nf=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.BLANK_URL=tr.relativeFirstCharacters=tr.whitespaceEscapeCharsRegex=tr.urlSchemeRegex=tr.ctrlCharactersRegex=tr.htmlCtrlEntityRegex=tr.htmlEntitiesRegex=tr.invalidProtocolRegex=void 0,tr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,tr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,tr.htmlCtrlEntityRegex=/&(newline|tab);/gi,tr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,tr.urlSchemeRegex=/^.+(:|:)/gim,tr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,tr.relativeFirstCharacters=[".","/"],tr.BLANK_URL="about:blank"),tr}var af;function KM(){if(af)return ka;af=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.sanitizeUrl=void 0;var e=ZM();function t(o){return e.relativeFirstCharacters.indexOf(o[0])>-1}function r(o){var s=o.replace(e.ctrlCharactersRegex,"");return s.replace(e.htmlEntitiesRegex,function(c,l){return String.fromCharCode(l)})}function i(o){return URL.canParse(o)}function n(o){try{return decodeURIComponent(o)}catch{return o}}function a(o){if(!o)return e.BLANK_URL;var s,c=n(o.trim());do c=r(c).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),c=n(c),s=c.match(e.ctrlCharactersRegex)||c.match(e.htmlEntitiesRegex)||c.match(e.htmlCtrlEntityRegex)||c.match(e.whitespaceEscapeCharsRegex);while(s&&s.length>0);var l=c;if(!l)return e.BLANK_URL;if(t(l))return l;var h=l.trimStart(),u=h.match(e.urlSchemeRegex);if(!u)return l;var f=u[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var d=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return d;if(f==="http:"||f==="https:"){if(!i(d))return e.BLANK_URL;var p=new URL(d);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return d}return ka.sanitizeUrl=a,ka}var QM=KM(),ib=typeof global=="object"&&global&&global.Object===Object&&global,JM=typeof self=="object"&&self&&self.Object===Object&&self,bi=ib||JM||Function("return this")(),Do=bi.Symbol,nb=Object.prototype,tL=nb.hasOwnProperty,eL=nb.toString,wa=Do?Do.toStringTag:void 0;function rL(e){var t=tL.call(e,wa),r=e[wa];try{e[wa]=void 0;var i=!0}catch{}var n=eL.call(e);return i&&(t?e[wa]=r:delete e[wa]),n}var iL=Object.prototype,nL=iL.toString;function aL(e){return nL.call(e)}var sL="[object Null]",oL="[object Undefined]",sf=Do?Do.toStringTag:void 0;function la(e){return e==null?e===void 0?oL:sL:sf&&sf in Object(e)?rL(e):aL(e)}function wn(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var lL="[object AsyncFunction]",cL="[object Function]",hL="[object GeneratorFunction]",uL="[object Proxy]";function cu(e){if(!wn(e))return!1;var t=la(e);return t==cL||t==hL||t==lL||t==uL}var Jl=bi["__core-js_shared__"],of=(function(){var e=/[^.]+$/.exec(Jl&&Jl.keys&&Jl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function dL(e){return!!of&&of in e}var fL=Function.prototype,pL=fL.toString;function Cn(e){if(e!=null){try{return pL.call(e)}catch{}try{return e+""}catch{}}return""}var gL=/[\\^$.*+?()[\]{}|]/g,mL=/^\[object .+?Constructor\]$/,bL=Function.prototype,yL=Object.prototype,xL=bL.toString,vL=yL.hasOwnProperty,_L=RegExp("^"+xL.call(vL).replace(gL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kL(e){if(!wn(e)||dL(e))return!1;var t=cu(e)?_L:mL;return t.test(Cn(e))}function wL(e,t){return e==null?void 0:e[t]}function Sn(e,t){var r=wL(e,t);return kL(r)?r:void 0}var ss=Sn(Object,"create");function CL(){this.__data__=ss?ss(null):{},this.size=0}function SL(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var TL="__lodash_hash_undefined__",EL=Object.prototype,AL=EL.hasOwnProperty;function ML(e){var t=this.__data__;if(ss){var r=t[e];return r===TL?void 0:r}return AL.call(t,e)?t[e]:void 0}var LL=Object.prototype,BL=LL.hasOwnProperty;function $L(e){var t=this.__data__;return ss?t[e]!==void 0:BL.call(t,e)}var RL="__lodash_hash_undefined__";function OL(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ss&&t===void 0?RL:t,this}function xn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}xn.prototype.clear=CL;xn.prototype.delete=SL;xn.prototype.get=ML;xn.prototype.has=$L;xn.prototype.set=OL;function NL(){this.__data__=[],this.size=0}function pl(e,t){return e===t||e!==e&&t!==t}function gl(e,t){for(var r=e.length;r--;)if(pl(e[r][0],t))return r;return-1}var IL=Array.prototype,DL=IL.splice;function FL(e){var t=this.__data__,r=gl(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():DL.call(t,r,1),--this.size,!0}function PL(e){var t=this.__data__,r=gl(t,e);return r<0?void 0:t[r][1]}function zL(e){return gl(this.__data__,e)>-1}function WL(e,t){var r=this.__data__,i=gl(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function $i(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}$i.prototype.clear=NL;$i.prototype.delete=FL;$i.prototype.get=PL;$i.prototype.has=zL;$i.prototype.set=WL;var os=Sn(bi,"Map");function qL(){this.size=0,this.__data__={hash:new xn,map:new(os||$i),string:new xn}}function HL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ml(e,t){var r=e.__data__;return HL(t)?r[typeof t=="string"?"string":"hash"]:r.map}function jL(e){var t=ml(this,e).delete(e);return this.size-=t?1:0,t}function UL(e){return ml(this,e).get(e)}function GL(e){return ml(this,e).has(e)}function YL(e,t){var r=ml(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function ji(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}ji.prototype.clear=qL;ji.prototype.delete=jL;ji.prototype.get=UL;ji.prototype.has=GL;ji.prototype.set=YL;var VL="Expected a function";function bs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(VL);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],a=r.cache;if(a.has(n))return a.get(n);var o=e.apply(this,i);return r.cache=a.set(n,o)||a,o};return r.cache=new(bs.Cache||ji),r}bs.Cache=ji;function XL(){this.__data__=new $i,this.size=0}function ZL(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function KL(e){return this.__data__.get(e)}function QL(e){return this.__data__.has(e)}var JL=200;function tB(e,t){var r=this.__data__;if(r instanceof $i){var i=r.__data__;if(!os||i.length<JL-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new ji(i)}return r.set(e,t),this.size=r.size,this}function ca(e){var t=this.__data__=new $i(e);this.size=t.size}ca.prototype.clear=XL;ca.prototype.delete=ZL;ca.prototype.get=KL;ca.prototype.has=QL;ca.prototype.set=tB;var Fo=(function(){try{var e=Sn(Object,"defineProperty");return e({},"",{}),e}catch{}})();function hu(e,t,r){t=="__proto__"&&Fo?Fo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Zc(e,t,r){(r!==void 0&&!pl(e[t],r)||r===void 0&&!(t in e))&&hu(e,t,r)}function eB(e){return function(t,r,i){for(var n=-1,a=Object(t),o=i(t),s=o.length;s--;){var c=o[++n];if(r(a[c],c,a)===!1)break}return t}}var rB=eB(),ab=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lf=ab&&typeof module=="object"&&module&&!module.nodeType&&module,iB=lf&&lf.exports===ab,cf=iB?bi.Buffer:void 0,hf=cf?cf.allocUnsafe:void 0;function nB(e,t){if(t)return e.slice();var r=e.length,i=hf?hf(r):new e.constructor(r);return e.copy(i),i}var uf=bi.Uint8Array;function aB(e){var t=new e.constructor(e.byteLength);return new uf(t).set(new uf(e)),t}function sB(e,t){var r=t?aB(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function oB(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}var df=Object.create,lB=(function(){function e(){}return function(t){if(!wn(t))return{};if(df)return df(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function sb(e,t){return function(r){return e(t(r))}}var ob=sb(Object.getPrototypeOf,Object),cB=Object.prototype;function bl(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||cB;return e===r}function hB(e){return typeof e.constructor=="function"&&!bl(e)?lB(ob(e)):{}}function ys(e){return e!=null&&typeof e=="object"}var uB="[object Arguments]";function ff(e){return ys(e)&&la(e)==uB}var lb=Object.prototype,dB=lb.hasOwnProperty,fB=lb.propertyIsEnumerable,Po=ff((function(){return arguments})())?ff:function(e){return ys(e)&&dB.call(e,"callee")&&!fB.call(e,"callee")},zo=Array.isArray,pB=9007199254740991;function cb(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pB}function yl(e){return e!=null&&cb(e.length)&&!cu(e)}function gB(e){return ys(e)&&yl(e)}function mB(){return!1}var hb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,pf=hb&&typeof module=="object"&&module&&!module.nodeType&&module,bB=pf&&pf.exports===hb,gf=bB?bi.Buffer:void 0,yB=gf?gf.isBuffer:void 0,uu=yB||mB,xB="[object Object]",vB=Function.prototype,_B=Object.prototype,ub=vB.toString,kB=_B.hasOwnProperty,wB=ub.call(Object);function CB(e){if(!ys(e)||la(e)!=xB)return!1;var t=ob(e);if(t===null)return!0;var r=kB.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ub.call(r)==wB}var SB="[object Arguments]",TB="[object Array]",EB="[object Boolean]",AB="[object Date]",MB="[object Error]",LB="[object Function]",BB="[object Map]",$B="[object Number]",RB="[object Object]",OB="[object RegExp]",NB="[object Set]",IB="[object String]",DB="[object WeakMap]",FB="[object ArrayBuffer]",PB="[object DataView]",zB="[object Float32Array]",WB="[object Float64Array]",qB="[object Int8Array]",HB="[object Int16Array]",jB="[object Int32Array]",UB="[object Uint8Array]",GB="[object Uint8ClampedArray]",YB="[object Uint16Array]",VB="[object Uint32Array]",ze={};ze[zB]=ze[WB]=ze[qB]=ze[HB]=ze[jB]=ze[UB]=ze[GB]=ze[YB]=ze[VB]=!0;ze[SB]=ze[TB]=ze[FB]=ze[EB]=ze[PB]=ze[AB]=ze[MB]=ze[LB]=ze[BB]=ze[$B]=ze[RB]=ze[OB]=ze[NB]=ze[IB]=ze[DB]=!1;function XB(e){return ys(e)&&cb(e.length)&&!!ze[la(e)]}function ZB(e){return function(t){return e(t)}}var db=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ga=db&&typeof module=="object"&&module&&!module.nodeType&&module,KB=Ga&&Ga.exports===db,tc=KB&&ib.process,mf=(function(){try{var e=Ga&&Ga.require&&Ga.require("util").types;return e||tc&&tc.binding&&tc.binding("util")}catch{}})(),bf=mf&&mf.isTypedArray,du=bf?ZB(bf):XB;function Kc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var QB=Object.prototype,JB=QB.hasOwnProperty;function t3(e,t,r){var i=e[t];(!(JB.call(e,t)&&pl(i,r))||r===void 0&&!(t in e))&&hu(e,t,r)}function e3(e,t,r,i){var n=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=void 0;c===void 0&&(c=e[s]),n?hu(r,s,c):t3(r,s,c)}return r}function r3(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var i3=9007199254740991,n3=/^(?:0|[1-9]\d*)$/;function fb(e,t){var r=typeof e;return t=t??i3,!!t&&(r=="number"||r!="symbol"&&n3.test(e))&&e>-1&&e%1==0&&e<t}var a3=Object.prototype,s3=a3.hasOwnProperty;function o3(e,t){var r=zo(e),i=!r&&Po(e),n=!r&&!i&&uu(e),a=!r&&!i&&!n&&du(e),o=r||i||n||a,s=o?r3(e.length,String):[],c=s.length;for(var l in e)(t||s3.call(e,l))&&!(o&&(l=="length"||n&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||fb(l,c)))&&s.push(l);return s}function l3(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var c3=Object.prototype,h3=c3.hasOwnProperty;function u3(e){if(!wn(e))return l3(e);var t=bl(e),r=[];for(var i in e)i=="constructor"&&(t||!h3.call(e,i))||r.push(i);return r}function pb(e){return yl(e)?o3(e,!0):u3(e)}function d3(e){return e3(e,pb(e))}function f3(e,t,r,i,n,a,o){var s=Kc(e,r),c=Kc(t,r),l=o.get(c);if(l){Zc(e,r,l);return}var h=a?a(s,c,r+"",e,t,o):void 0,u=h===void 0;if(u){var f=zo(c),d=!f&&uu(c),p=!f&&!d&&du(c);h=c,f||d||p?zo(s)?h=s:gB(s)?h=oB(s):d?(u=!1,h=nB(c,!0)):p?(u=!1,h=sB(c,!0)):h=[]:CB(c)||Po(c)?(h=s,Po(s)?h=d3(s):(!wn(s)||cu(s))&&(h=hB(c))):u=!1}u&&(o.set(c,h),n(h,c,i,a,o),o.delete(c)),Zc(e,r,h)}function gb(e,t,r,i,n){e!==t&&rB(t,function(a,o){if(n||(n=new ca),wn(a))f3(e,t,o,r,gb,i,n);else{var s=i?i(Kc(e,o),a,o+"",e,t,n):void 0;s===void 0&&(s=a),Zc(e,o,s)}},pb)}function mb(e){return e}function p3(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var yf=Math.max;function g3(e,t,r){return t=yf(t===void 0?e.length-1:t,0),function(){for(var i=arguments,n=-1,a=yf(i.length-t,0),o=Array(a);++n<a;)o[n]=i[t+n];n=-1;for(var s=Array(t+1);++n<t;)s[n]=i[n];return s[t]=r(o),p3(e,this,s)}}function m3(e){return function(){return e}}var b3=Fo?function(e,t){return Fo(e,"toString",{configurable:!0,enumerable:!1,value:m3(t),writable:!0})}:mb,y3=800,x3=16,v3=Date.now;function _3(e){var t=0,r=0;return function(){var i=v3(),n=x3-(i-r);if(r=i,n>0){if(++t>=y3)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var k3=_3(b3);function w3(e,t){return k3(g3(e,t,mb),e+"")}function C3(e,t,r){if(!wn(r))return!1;var i=typeof t;return(i=="number"?yl(r)&&fb(t,r.length):i=="string"&&t in r)?pl(r[t],e):!1}function S3(e){return w3(function(t,r){var i=-1,n=r.length,a=n>1?r[n-1]:void 0,o=n>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(n--,a):void 0,o&&C3(r[0],r[1],o)&&(a=n<3?void 0:a,n=1),t=Object(t);++i<n;){var s=r[i];s&&e(t,s,i,a)}return t})}var T3=S3(function(e,t,r){gb(e,t,r)}),E3="",A3={curveBasis:Zs,curveBasisClosed:J2,curveBasisOpen:tC,curveBumpX:og,curveBumpY:lg,curveBundle:eC,curveCardinalClosed:rC,curveCardinalOpen:iC,curveCardinal:dg,curveCatmullRomClosed:nC,curveCatmullRomOpen:aC,curveCatmullRom:pg,curveLinear:yo,curveLinearClosed:sC,curveMonotoneX:vg,curveMonotoneY:_g,curveNatural:wg,curveStep:Cg,curveStepAfter:Tg,curveStepBefore:Sg},M3=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,L3=m(function(e,t){const r=bb(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const o=r.map(s=>s.args);To(o),i=er(i,[...o])}else i=r.args;if(!i)return;let n=Vh(e,t);const a="config";return i[a]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),i[n]=i[a],delete i[a]),i},"detectInit"),bb=m(function(e,t=null){var r,i;try{const n=new RegExp(`[%]{2}(?![{]${M3.source})(?=[}][%]{2}).*
|
|
192
|
+
`,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"'),rt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let a;const o=[];for(;(a=ja.exec(e))!==null;)if(a.index===ja.lastIndex&&ja.lastIndex++,a&&!t||t&&((r=a[1])!=null&&r.match(t))||t&&((i=a[2])!=null&&i.match(t))){const s=a[1]?a[1]:a[2],c=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;o.push({type:s,args:c})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(n){return rt.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),B3=m(function(e){return e.replace(ja,"")},"removeDirectives"),$3=m(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function fu(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return A3[r]??t}m(fu,"interpolateToCurve");function yb(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?QM.sanitizeUrl(r):r}m(yb,"formatUrl");var R3=m((e,...t)=>{const r=e.split("."),i=r.length-1,n=r[i];let a=window;for(let o=0;o<i;o++)if(a=a[r[o]],!a){rt.error(`Function name: ${e} not found in window`);return}a[n](...t)},"runFunc");function pu(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}m(pu,"distance");function xb(e){let t,r=0;e.forEach(n=>{r+=pu(n,t),t=n});const i=r/2;return gu(e,i)}m(xb,"traverseEdge");function vb(e){return e.length===1?e[0]:xb(e)}m(vb,"calcLabelPosition");var xf=m((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),gu=m((e,t)=>{let r,i=t;for(const n of e){if(r){const a=pu(n,r);if(a===0)return r;if(a<i)i-=a;else{const o=i/a;if(o<=0)return r;if(o>=1)return{x:n.x,y:n.y};if(o>0&&o<1)return{x:xf((1-o)*r.x+o*n.x,5),y:xf((1-o)*r.y+o*n.y,5)}}}r=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),O3=m((e,t,r)=>{rt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const n=gu(t,25),a=e?10:5,o=Math.atan2(t[0].y-n.y,t[0].x-n.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(t[0].x+n.x)/2,s.y=-Math.cos(o)*a+(t[0].y+n.y)/2,s},"calcCardinalityPosition");function _b(e,t,r){const i=structuredClone(r);rt.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const n=25+e,a=gu(i,n),o=10+e*.5,s=Math.atan2(i[0].y-a.y,i[0].x-a.x),c={x:0,y:0};return t==="start_left"?(c.x=Math.sin(s+Math.PI)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s+Math.PI)*o+(i[0].y+a.y)/2):t==="end_right"?(c.x=Math.sin(s-Math.PI)*o+(i[0].x+a.x)/2-5,c.y=-Math.cos(s-Math.PI)*o+(i[0].y+a.y)/2-5):t==="end_left"?(c.x=Math.sin(s)*o+(i[0].x+a.x)/2-5,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2-5):(c.x=Math.sin(s)*o+(i[0].x+a.x)/2,c.y=-Math.cos(s)*o+(i[0].y+a.y)/2),c}m(_b,"calcTerminalLabelPosition");function kb(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}m(kb,"getStylesFromArray");var vf=0,N3=m(()=>(vf++,"id-"+Math.random().toString(36).substr(2,12)+"-"+vf),"generateId");function wb(e){let t="";const r="0123456789abcdef",i=r.length;for(let n=0;n<e;n++)t+=r.charAt(Math.floor(Math.random()*i));return t}m(wb,"makeRandomHex");var I3=m(e=>wb(e.length),"random"),D3=m(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),F3=m(function(e,t){const r=t.text.replace(sa.lineBreakRegex," "),[,i]=xl(t.fontSize),n=e.append("text");n.attr("x",t.x),n.attr("y",t.y),n.style("text-anchor",t.anchor),n.style("font-family",t.fontFamily),n.style("font-size",i),n.style("font-weight",t.fontWeight),n.attr("fill",t.fill),t.class!==void 0&&n.attr("class",t.class);const a=n.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),n},"drawSimpleText"),P3=bs((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),sa.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),n=[];let a="";return i.forEach((o,s)=>{const c=Li(`${o} `,r),l=Li(a,r);if(c>t){const{hyphenatedStrings:f,remainingWord:d}=z3(o,t,"-",r);n.push(a,...f),a=d}else l+c>=t?(n.push(a),a=o):a=[a,o].filter(Boolean).join(" ");s+1===i.length&&n.push(a)}),n.filter(o=>o!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),z3=bs((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const n=[...e],a=[];let o="";return n.forEach((s,c)=>{const l=`${o}${s}`;if(Li(l,i)>=t){const u=c+1,f=n.length===u,d=`${l}${r}`;a.push(f?l:d),o=""}else o=l}),{hyphenatedStrings:a,remainingWord:o}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Cb(e,t){return mu(e,t).height}m(Cb,"calculateTextHeight");function Li(e,t){return mu(e,t).width}m(Li,"calculateTextWidth");var mu=bs((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:n=400}=t;if(!e)return{width:0,height:0};const[,a]=xl(r),o=["sans-serif",i],s=e.split(sa.lineBreakRegex),c=[],l=se("body");if(!l.remove)return{width:0,height:0,lineHeight:0};const h=l.append("svg");for(const f of o){let d=0;const p={width:0,height:0,lineHeight:0};for(const g of s){const b=D3();b.text=g||E3;const y=F3(h,b).style("font-size",a).style("font-weight",n).style("font-family",f),x=(y._groups||y)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,x.width)),d=Math.round(x.height),p.height+=d,p.lineHeight=Math.round(Math.max(p.lineHeight,d))}c.push(p)}h.remove();const u=isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1;return c[u]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Yn,W3=(Yn=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},m(Yn,"InitIDGenerator"),Yn),Os,q3=m(function(e){return Os=Os||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Os.innerHTML=e,unescape(Os.textContent)},"entityDecode");function bu(e){return"str"in e}m(bu,"isDetailedError");var H3=m((e,t,r,i)=>{var a;if(!i)return;const n=(a=e.node())==null?void 0:a.getBBox();n&&e.append("text").text(i).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-r).attr("class",t)},"insertTitle"),xl=m(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function yu(e,t){return T3({},e,t)}m(yu,"cleanAndMerge");var Jr={assignWithDepth:er,wrapLabel:P3,calculateTextHeight:Cb,calculateTextWidth:Li,calculateTextDimensions:mu,cleanAndMerge:yu,detectInit:L3,detectDirective:bb,isSubstringInArray:$3,interpolateToCurve:fu,calcLabelPosition:vb,calcCardinalityPosition:O3,calcTerminalLabelPosition:_b,formatUrl:yb,getStylesFromArray:kb,generateId:N3,random:I3,runFunc:R3,entityDecode:q3,insertTitle:H3,isLabelCoordinateInPath:Sb,parseFontSize:xl,InitIDGenerator:W3},j3=m(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Tn=m(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),LD=m((e,t,{counter:r=0,prefix:i,suffix:n},a)=>a||`${i?`${i}_`:""}${e}_${t}_${r}${n?`_${n}`:""}`,"getEdgeId");function br(e){return e??null}m(br,"handleUndefinedAttr");function Sb(e,t){const r=Math.round(e.x),i=Math.round(e.y),n=t.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return n.includes(r.toString())||n.includes(i.toString())}m(Sb,"isLabelCoordinateInPath");const U3=Object.freeze({left:0,top:0,width:16,height:16}),Wo=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Tb=Object.freeze({...U3,...Wo}),G3=Object.freeze({...Tb,body:"",hidden:!1}),Y3=Object.freeze({width:null,height:null}),V3=Object.freeze({...Y3,...Wo}),X3=(e,t,r,i="")=>{const n=e.split(":");if(e.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const s=n.pop(),c=n.pop(),l={provider:n.length>0?n[0]:i,prefix:c,name:s};return ec(l)?l:null}const a=n[0],o=a.split("-");if(o.length>1){const s={provider:i,prefix:o.shift(),name:o.join("-")};return ec(s)?s:null}if(r&&i===""){const s={provider:i,prefix:"",name:a};return ec(s,r)?s:null}return null},ec=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Z3(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function _f(e,t){const r=Z3(e,t);for(const i in G3)i in Wo?i in e&&!(i in r)&&(r[i]=Wo[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function K3(e,t){const r=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);function a(o){if(r[o])return n[o]=[];if(!(o in n)){n[o]=null;const s=i[o]&&i[o].parent,c=s&&a(s);c&&(n[o]=[s].concat(c))}return n[o]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(a),n}function kf(e,t,r){const i=e.icons,n=e.aliases||Object.create(null);let a={};function o(s){a=_f(i[s]||n[s],a)}return o(t),r.forEach(o),_f(e,a)}function Q3(e,t){if(e.icons[t])return kf(e,t,[]);const r=K3(e,[t])[t];return r?kf(e,t,r):null}const J3=/(-?[0-9.]*[0-9]+[0-9.]*)/g,t$=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function wf(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(J3);if(i===null||!i.length)return e;const n=[];let a=i.shift(),o=t$.test(a);for(;;){if(o){const s=parseFloat(a);isNaN(s)?n.push(a):n.push(Math.ceil(s*t*r)/r)}else n.push(a);if(a=i.shift(),a===void 0)return n.join("");o=!o}}function e$(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const n=e.indexOf(">",i),a=e.indexOf("</"+t);if(n===-1||a===-1)break;const o=e.indexOf(">",a);if(o===-1)break;r+=e.slice(n+1,a).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:r,content:e}}function r$(e,t){return e?"<defs>"+e+"</defs>"+t:t}function i$(e,t,r){const i=e$(e);return r$(i.defs,t+i.content+r)}const n$=e=>e==="unset"||e==="undefined"||e==="none";function a$(e,t){const r={...Tb,...e},i={...V3,...t},n={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,i].forEach(g=>{const b=[],y=g.hFlip,x=g.vFlip;let C=g.rotate;y?x?C+=2:(b.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),b.push("scale(-1 1)"),n.top=n.left=0):x&&(b.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),b.push("scale(1 -1)"),n.top=n.left=0);let A;switch(C<0&&(C-=Math.floor(C/4)*4),C=C%4,C){case 1:A=n.height/2+n.top,b.unshift("rotate(90 "+A.toString()+" "+A.toString()+")");break;case 2:b.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:A=n.width/2+n.left,b.unshift("rotate(-90 "+A.toString()+" "+A.toString()+")");break}C%2===1&&(n.left!==n.top&&(A=n.left,n.left=n.top,n.top=A),n.width!==n.height&&(A=n.width,n.width=n.height,n.height=A)),b.length&&(a=i$(a,'<g transform="'+b.join(" ")+'">',"</g>"))});const o=i.width,s=i.height,c=n.width,l=n.height;let h,u;o===null?(u=s===null?"1em":s==="auto"?l:s,h=wf(u,c/l)):(h=o==="auto"?c:o,u=s===null?wf(h,l/c):s==="auto"?l:s);const f={},d=(g,b)=>{n$(b)||(f[g]=b.toString())};d("width",h),d("height",u);const p=[n.left,n.top,c,l];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:a}}const s$=/\sid="(\S+)"/g,Cf=new Map;function o$(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Cf.get(e)||0;return Cf.set(e,t+1),t?`${e}${t}`:e}function l$(e){const t=[];let r;for(;r=s$.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(n=>{const a=o$(n),o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function c$(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function xu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var En=xu();function Eb(e){En=e}var Ya={exec:()=>null};function Se(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(wr.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,t)};return i}var h$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),wr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},u$=/^(?:[ \t]*(?:\n|$))+/,d$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,f$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vu=/(?:[*+-]|\d{1,9}[.)])/,Ab=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mb=Se(Ab).replace(/bull/g,vu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),g$=Se(Ab).replace(/bull/g,vu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_u=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m$=/^[^\n]+/,ku=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,b$=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ku).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),y$=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,vu).getRegex(),vl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",wu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x$=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",wu).replace("tag",vl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lb=Se(_u).replace("hr",xs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vl).getRegex(),v$=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Lb).getRegex(),Cu={blockquote:v$,code:d$,def:b$,fences:f$,heading:p$,hr:xs,html:x$,lheading:Mb,list:y$,newline:u$,paragraph:Lb,table:Ya,text:m$},Sf=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vl).getRegex(),_$={...Cu,lheading:g$,table:Sf,paragraph:Se(_u).replace("hr",xs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vl).getRegex()},k$={...Cu,html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wu).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ya,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(_u).replace("hr",xs).replace("heading",` *#{1,6} *[^
|
|
193
|
+
]`).replace("lheading",Mb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},w$=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,C$=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bb=/^( {2,}|\\)\n(?!\s*$)/,S$=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_l=/[\p{P}\p{S}]/u,Su=/[\s\p{P}\p{S}]/u,$b=/[^\s\p{P}\p{S}]/u,T$=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Su).getRegex(),Rb=/(?!~)[\p{P}\p{S}]/u,E$=/(?!~)[\s\p{P}\p{S}]/u,A$=/(?:[^\s\p{P}\p{S}]|~)/u,M$=Se(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",h$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ob=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,L$=Se(Ob,"u").replace(/punct/g,_l).getRegex(),B$=Se(Ob,"u").replace(/punct/g,Rb).getRegex(),Nb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$$=Se(Nb,"gu").replace(/notPunctSpace/g,$b).replace(/punctSpace/g,Su).replace(/punct/g,_l).getRegex(),R$=Se(Nb,"gu").replace(/notPunctSpace/g,A$).replace(/punctSpace/g,E$).replace(/punct/g,Rb).getRegex(),O$=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$b).replace(/punctSpace/g,Su).replace(/punct/g,_l).getRegex(),N$=Se(/\\(punct)/,"gu").replace(/punct/g,_l).getRegex(),I$=Se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),D$=Se(wu).replace("(?:-->|$)","-->").getRegex(),F$=Se("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",D$).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,P$=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",qo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ib=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",qo).replace("ref",ku).getRegex(),Db=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",ku).getRegex(),z$=Se("reflink|nolink(?!\\()","g").replace("reflink",Ib).replace("nolink",Db).getRegex(),Tf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Tu={_backpedal:Ya,anyPunctuation:N$,autolink:I$,blockSkip:M$,br:Bb,code:C$,del:Ya,emStrongLDelim:L$,emStrongRDelimAst:$$,emStrongRDelimUnd:O$,escape:w$,link:P$,nolink:Db,punctuation:T$,reflink:Ib,reflinkSearch:z$,tag:F$,text:S$,url:Ya},W$={...Tu,link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",qo).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qo).getRegex()},Qc={...Tu,emStrongRDelimAst:R$,emStrongLDelim:B$,url:Se(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Tf).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Se(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Tf).getRegex()},q$={...Qc,br:Se(Bb).replace("{2,}","*").getRegex(),text:Se(Qc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ns={normal:Cu,gfm:_$,pedantic:k$},Ca={normal:Tu,gfm:Qc,breaks:q$,pedantic:W$},H$={"&":"&","<":"<",">":">",'"':""","'":"'"},Ef=e=>H$[e];function ci(e,t){if(t){if(wr.escapeTest.test(e))return e.replace(wr.escapeReplace,Ef)}else if(wr.escapeTestNoEncode.test(e))return e.replace(wr.escapeReplaceNoEncode,Ef);return e}function Af(e){try{e=encodeURI(e).replace(wr.percentDecode,"%")}catch{return null}return e}function Mf(e,t){var a;let r=e.replace(wr.findPipe,(o,s,c)=>{let l=!1,h=s;for(;--h>=0&&c[h]==="\\";)l=!l;return l?"|":" |"}),i=r.split(wr.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(wr.slashPipe,"|");return i}function Sa(e,t,r){let i=e.length;if(i===0)return"";let n=0;for(;n<i&&e.charAt(i-n-1)===t;)n++;return e.slice(0,i-n)}function j$(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function Lf(e,t,r,i,n){let a=t.href,o=t.title||null,s=e[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,c}function U$(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let n=i[1];return t.split(`
|
|
194
|
+
`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=n.length?a.slice(n.length):a}).join(`
|
|
195
|
+
`)}var Ho=class{constructor(t){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=t||En}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Sa(i,`
|
|
196
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],n=U$(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:n}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let n=Sa(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Sa(r[0],`
|
|
197
|
+
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Sa(r[0],`
|
|
198
|
+
`).split(`
|
|
199
|
+
`),n="",a="",o=[];for(;i.length>0;){let s=!1,c=[],l;for(l=0;l<i.length;l++)if(this.rules.other.blockquoteStart.test(i[l]))c.push(i[l]),s=!0;else if(!s)c.push(i[l]);else break;i=i.slice(l);let h=c.join(`
|
|
200
|
+
`),u=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
201
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
202
|
+
${h}`:h,a=a?`${a}
|
|
203
|
+
${u}`:u;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,o,!0),this.lexer.state.top=f,i.length===0)break;let d=o.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){let p=d,g=p.raw+`
|
|
204
|
+
`+i.join(`
|
|
205
|
+
`),b=this.blockquote(g);o[o.length-1]=b,n=n.substring(0,n.length-p.raw.length)+b.raw,a=a.substring(0,a.length-p.text.length)+b.text;break}else if((d==null?void 0:d.type)==="list"){let p=d,g=p.raw+`
|
|
206
|
+
`+i.join(`
|
|
207
|
+
`),b=this.list(g);o[o.length-1]=b,n=n.substring(0,n.length-d.raw.length)+b.raw,a=a.substring(0,a.length-p.raw.length)+b.raw,i=g.substring(o.at(-1).raw.length).split(`
|
|
208
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:o,text:a}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),n=i.length>1,a={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let o=this.rules.other.listItemRegex(i),s=!1;for(;t;){let l=!1,h="",u="";if(!(r=o.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(`
|
|
209
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),d=t.split(`
|
|
210
|
+
`,1)[0],p=!f.trim(),g=0;if(this.options.pedantic?(g=2,u=f.trimStart()):p?g=r[1].length+1:(g=r[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=f.slice(g),g+=r[1].length),p&&this.rules.other.blankLine.test(d)&&(h+=d+`
|
|
211
|
+
`,t=t.substring(d.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(g),C=this.rules.other.hrRegex(g),A=this.rules.other.fencesBeginRegex(g),B=this.rules.other.headingBeginRegex(g),w=this.rules.other.htmlBeginRegex(g);for(;t;){let E=t.split(`
|
|
212
|
+
`,1)[0],I;if(d=E,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),I=d):I=d.replace(this.rules.other.tabCharGlobal," "),A.test(d)||B.test(d)||w.test(d)||x.test(d)||C.test(d))break;if(I.search(this.rules.other.nonSpaceChar)>=g||!d.trim())u+=`
|
|
213
|
+
`+I.slice(g);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(f)||B.test(f)||C.test(f))break;u+=`
|
|
214
|
+
`+d}!p&&!d.trim()&&(p=!0),h+=E+`
|
|
215
|
+
`,t=t.substring(E.length+1),f=I.slice(g)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(s=!0));let b=null,y;this.options.gfm&&(b=this.rules.other.listIsTask.exec(u),b&&(y=b[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!b,checked:y,loose:!1,text:u,tokens:[]}),a.raw+=h}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let l=0;l<a.items.length;l++)if(this.lexer.state.top=!1,a.items[l].tokens=this.lexer.blockTokens(a.items[l].text,[]),!a.loose){let h=a.items[l].tokens.filter(f=>f.type==="space"),u=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=u}if(a.loose)for(let l=0;l<a.items.length;l++)a.items[l].loose=!0;return a}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:n,title:a}}}table(t){var s;let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=Mf(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=r[3])!=null&&s.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
216
|
+
`):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===n.length){for(let c of n)this.rules.other.tableAlignRight.test(c)?o.align.push("right"):this.rules.other.tableAlignCenter.test(c)?o.align.push("center"):this.rules.other.tableAlignLeft.test(c)?o.align.push("left"):o.align.push(null);for(let c=0;c<i.length;c++)o.header.push({text:i[c],tokens:this.lexer.inline(i[c]),header:!0,align:o.align[c]});for(let c of a)o.rows.push(Mf(c,o.header.length).map((l,h)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[h]})));return o}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
217
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=Sa(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=j$(r[2],"()");if(o===-2)return;if(o>-1){let s=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,s).trim(),r[3]=""}}let n=r[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],a=o[3])}else a=r[3]?r[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),Lf(r,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[n.toLowerCase()];if(!a){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return Lf(i,a,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||n[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!i||this.rules.inline.punctuation.exec(i))){let a=[...n[0]].length-1,o,s,c=a,l=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+a);(n=h.exec(r))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){c+=s;continue}else if((n[5]||n[6])&&a%3&&!((a+s)%3)){l+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+l);let u=[...n[0]][0].length,f=t.slice(0,a+n.index+u+s);if(Math.min(a,s)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,n;return r[2]==="@"?(i=r[1],n="mailto:"+i):(i=r[1],n=i),{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i;let r;if(r=this.rules.inline.url.exec(t)){let n,a;if(r[2]==="@")n=r[0],a="mailto:"+n;else{let o;do o=r[0],r[0]=((i=this.rules.inline._backpedal.exec(r[0]))==null?void 0:i[0])??"";while(o!==r[0]);n=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Zr=class Jc{constructor(t){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"tokenizer");jt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||En,this.options.tokenizer=this.options.tokenizer||new Ho,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:wr,block:Ns.normal,inline:Ca.normal};this.options.pedantic?(r.block=Ns.pedantic,r.inline=Ca.pedantic):this.options.gfm&&(r.block=Ns.gfm,this.options.breaks?r.inline=Ca.breaks:r.inline=Ca.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ns,inline:Ca}}static lex(t,r){return new Jc(r).lex(t)}static lexInline(t,r){return new Jc(r).inlineTokens(t)}lex(t){t=t.replace(wr.carriageReturn,`
|
|
218
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){var n,a,o;for(this.options.pedantic&&(t=t.replace(wr.tabCharGlobal," ").replace(wr.spaceLine,""));t;){let s;if((a=(n=this.options.extensions)==null?void 0:n.block)!=null&&a.some(l=>(s=l.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let l=r.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
|
|
219
|
+
`:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(`
|
|
220
|
+
`)?"":`
|
|
221
|
+
`)+s.raw,l.text+=`
|
|
222
|
+
`+s.text,this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(`
|
|
223
|
+
`)?"":`
|
|
224
|
+
`)+s.raw,l.text+=`
|
|
225
|
+
`+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let c=t;if((o=this.options.extensions)!=null&&o.startBlock){let l=1/0,h=t.slice(1),u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=t.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(c))){let l=r.at(-1);i&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
226
|
+
`)?"":`
|
|
227
|
+
`)+s.raw,l.text+=`
|
|
228
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s),i=c.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let l=r.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=(l.raw.endsWith(`
|
|
229
|
+
`)?"":`
|
|
230
|
+
`)+s.raw,l.text+=`
|
|
231
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(s);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var c,l,h,u,f;let i=t,n=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)a=n[2]?n[2].length:0,i=i.slice(0,n.index+a)+"["+"a".repeat(n[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((l=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:l.call({lexer:this},i))??i;let o=!1,s="";for(;t;){o||(s=""),o=!1;let d;if((u=(h=this.options.extensions)==null?void 0:h.inline)!=null&&u.some(g=>(d=g.call({lexer:this},t,r))?(t=t.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let g=r.at(-1);d.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(t,i,s)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),r.push(d);continue}let p=t;if((f=this.options.extensions)!=null&&f.startInline){let g=1/0,b=t.slice(1),y;this.options.extensions.startInline.forEach(x=>{y=x.call({lexer:this},b),typeof y=="number"&&y>=0&&(g=Math.min(g,y))}),g<1/0&&g>=0&&(p=t.substring(0,g+1))}if(d=this.tokenizer.inlineText(p)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(s=d.raw.slice(-1)),o=!0;let g=r.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):r.push(d);continue}if(t){let g="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return r}},jo=class{constructor(t){jt(this,"options");jt(this,"parser");this.options=t||En}space(t){return""}code({text:t,lang:r,escaped:i}){var o;let n=(o=(r||"").match(wr.notSpaceStart))==null?void 0:o[0],a=t.replace(wr.endingNewline,"")+`
|
|
232
|
+
`;return n?'<pre><code class="language-'+ci(n)+'">'+(i?a:ci(a,!0))+`</code></pre>
|
|
233
|
+
`:"<pre><code>"+(i?a:ci(a,!0))+`</code></pre>
|
|
234
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
235
|
+
${this.parser.parse(t)}</blockquote>
|
|
236
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
237
|
+
`}hr(t){return`<hr>
|
|
238
|
+
`}list(t){let r=t.ordered,i=t.start,n="";for(let s=0;s<t.items.length;s++){let c=t.items[s];n+=this.listitem(c)}let a=r?"ol":"ul",o=r&&i!==1?' start="'+i+'"':"";return"<"+a+o+`>
|
|
239
|
+
`+n+"</"+a+`>
|
|
240
|
+
`}listitem(t){var i;let r="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?((i=t.tokens[0])==null?void 0:i.type)==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+ci(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):r+=n+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
|
|
241
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
242
|
+
`}table(t){let r="",i="";for(let a=0;a<t.header.length;a++)i+=this.tablecell(t.header[a]);r+=this.tablerow({text:i});let n="";for(let a=0;a<t.rows.length;a++){let o=t.rows[a];i="";for(let s=0;s<o.length;s++)i+=this.tablecell(o[s]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
243
|
+
<thead>
|
|
244
|
+
`+r+`</thead>
|
|
245
|
+
`+n+`</table>
|
|
246
|
+
`}tablerow({text:t}){return`<tr>
|
|
247
|
+
${t}</tr>
|
|
248
|
+
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
249
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ci(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let n=this.parser.parseInline(i),a=Af(t);if(a===null)return n;t=a;let o='<a href="'+t+'"';return r&&(o+=' title="'+ci(r)+'"'),o+=">"+n+"</a>",o}image({href:t,title:r,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let a=Af(t);if(a===null)return ci(i);t=a;let o=`<img src="${t}" alt="${i}"`;return r&&(o+=` title="${ci(r)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ci(t.text)}},Eu=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Kr=class th{constructor(t){jt(this,"options");jt(this,"renderer");jt(this,"textRenderer");this.options=t||En,this.options.renderer=this.options.renderer||new jo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Eu}static parse(t,r){return new th(r).parse(t)}static parseInline(t,r){return new th(r).parseInline(t)}parse(t,r=!0){var n,a;let i="";for(let o=0;o<t.length;o++){let s=t[o];if((a=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&a[s.type]){let l=s,h=this.options.extensions.renderers[l.type].call({parser:this},l);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){i+=h||"";continue}}let c=s;switch(c.type){case"space":{i+=this.renderer.space(c);continue}case"hr":{i+=this.renderer.hr(c);continue}case"heading":{i+=this.renderer.heading(c);continue}case"code":{i+=this.renderer.code(c);continue}case"table":{i+=this.renderer.table(c);continue}case"blockquote":{i+=this.renderer.blockquote(c);continue}case"list":{i+=this.renderer.list(c);continue}case"html":{i+=this.renderer.html(c);continue}case"def":{i+=this.renderer.def(c);continue}case"paragraph":{i+=this.renderer.paragraph(c);continue}case"text":{let l=c,h=this.renderer.text(l);for(;o+1<t.length&&t[o+1].type==="text";)l=t[++o],h+=`
|
|
250
|
+
`+this.renderer.text(l);r?i+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):i+=h;continue}default:{let l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(t,r=this.renderer){var n,a;let i="";for(let o=0;o<t.length;o++){let s=t[o];if((a=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&a[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let c=s;switch(c.type){case"escape":{i+=r.text(c);break}case"html":{i+=r.html(c);break}case"link":{i+=r.link(c);break}case"image":{i+=r.image(c);break}case"strong":{i+=r.strong(c);break}case"em":{i+=r.em(c);break}case"codespan":{i+=r.codespan(c);break}case"br":{i+=r.br(c);break}case"del":{i+=r.del(c);break}case"text":{i+=r.text(c);break}default:{let l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},qs,Ia=(qs=class{constructor(t){jt(this,"options");jt(this,"block");this.options=t||En}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Zr.lex:Zr.lexInline}provideParser(){return this.block?Kr.parse:Kr.parseInline}},jt(qs,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),jt(qs,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),qs),G$=class{constructor(...t){jt(this,"defaults",xu());jt(this,"options",this.setOptions);jt(this,"parse",this.parseMarkdown(!0));jt(this,"parseInline",this.parseMarkdown(!1));jt(this,"Parser",Kr);jt(this,"Renderer",jo);jt(this,"TextRenderer",Eu);jt(this,"Lexer",Zr);jt(this,"Tokenizer",Ho);jt(this,"Hooks",Ia);this.use(...t)}walkTokens(t,r){var n,a;let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let c of s.header)i=i.concat(this.walkTokens(c.tokens,r));for(let c of s.rows)for(let l of c)i=i.concat(this.walkTokens(l.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;(a=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(c=>{let l=s[c].flat(1/0);i=i.concat(this.walkTokens(l,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let o=r.renderers[a.name];o?r.renderers[a.name]=function(...s){let c=a.renderer.apply(this,s);return c===!1&&(c=o.apply(this,s)),c}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[a.level];o?o.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),n.extensions=r),i.renderer){let a=this.defaults.renderer||new jo(this.defaults);for(let o in i.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,c=i.renderer[s],l=a[s];a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u||""}}n.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new Ho(this.defaults);for(let o in i.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,c=i.tokenizer[s],l=a[s];a[s]=(...h)=>{let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u}}n.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new Ia;for(let o in i.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,c=i.hooks[s],l=a[s];Ia.passThroughHooks.has(o)?a[s]=h=>{if(this.defaults.async&&Ia.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await c.call(a,h);return l.call(a,f)})();let u=c.call(a,h);return l.call(a,u)}:a[s]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(a,h);return f===!1&&(f=await l.apply(a,h)),f})();let u=c.apply(a,h);return u===!1&&(u=l.apply(a,h)),u}}n.hooks=a}if(i.walkTokens){let a=this.defaults.walkTokens,o=i.walkTokens;n.walkTokens=function(s){let c=[];return c.push(o.call(this,s)),a&&(c=c.concat(a.call(this,s))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Zr.lex(t,r??this.defaults)}parser(t,r){return Kr.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let n={...i},a={...this.defaults,...n},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(r):r,c=await(a.hooks?await a.hooks.provideLexer():t?Zr.lex:Zr.lexInline)(s,a),l=a.hooks?await a.hooks.processAllTokens(c):c;a.walkTokens&&await Promise.all(this.walkTokens(l,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():t?Kr.parse:Kr.parseInline)(l,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(o);try{a.hooks&&(r=a.hooks.preprocess(r));let s=(a.hooks?a.hooks.provideLexer():t?Zr.lex:Zr.lexInline)(r,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let c=(a.hooks?a.hooks.provideParser():t?Kr.parse:Kr.parseInline)(s,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(s){return o(s)}}}onError(t,r){return i=>{if(i.message+=`
|
|
251
|
+
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+ci(i.message+"",!0)+"</pre>";return r?Promise.resolve(n):n}if(r)return Promise.reject(i);throw i}}},vn=new G$;function Oe(e,t){return vn.parse(e,t)}Oe.options=Oe.setOptions=function(e){return vn.setOptions(e),Oe.defaults=vn.defaults,Eb(Oe.defaults),Oe};Oe.getDefaults=xu;Oe.defaults=En;Oe.use=function(...e){return vn.use(...e),Oe.defaults=vn.defaults,Eb(Oe.defaults),Oe};Oe.walkTokens=function(e,t){return vn.walkTokens(e,t)};Oe.parseInline=vn.parseInline;Oe.Parser=Kr;Oe.parser=Kr.parse;Oe.Renderer=jo;Oe.TextRenderer=Eu;Oe.Lexer=Zr;Oe.lexer=Zr.lex;Oe.Tokenizer=Ho;Oe.Hooks=Ia;Oe.parse=Oe;Oe.options;Oe.setOptions;Oe.use;Oe.walkTokens;Oe.parseInline;Kr.parse;Zr.lex;function Fb(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var n=i.reduce(function(s,c){var l=c.match(/\n([\t ]+|(?!\s).)/g);return l?s.concat(l.map(function(h){var u,f;return(f=(u=h.match(/[\t ]/g))===null||u===void 0?void 0:u.length)!==null&&f!==void 0?f:0})):s},[]);if(n.length){var a=new RegExp(`
|
|
252
|
+
[ ]{`+Math.min.apply(Math,n)+"}","g");i=i.map(function(s){return s.replace(a,`
|
|
253
|
+
`)})}i[0]=i[0].replace(/^\r?\n/,"");var o=i[0];return t.forEach(function(s,c){var l=o.match(/(?:^|\n)( *)$/),h=l?l[1]:"",u=s;typeof s=="string"&&s.includes(`
|
|
254
|
+
`)&&(u=String(s).split(`
|
|
255
|
+
`).map(function(f,d){return d===0?f:""+h+f}).join(`
|
|
256
|
+
`)),o+=u+i[c+1]}),o}var Y$={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},eh=new Map,Pb=new Map,V$=m(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(rt.debug("Registering icon pack:",t.name),"loader"in t)Pb.set(t.name,t.loader);else if("icons"in t)eh.set(t.name,t.icons);else throw rt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),zb=m(async(e,t)=>{const r=X3(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let n=eh.get(i);if(!n){const o=Pb.get(i);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{n={...await o(),prefix:i},eh.set(i,n)}catch(s){throw rt.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Q3(n,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),X$=m(async e=>{try{return await zb(e),!0}catch{return!1}},"isIconAvailable"),vs=m(async(e,t,r)=>{let i;try{i=await zb(e,t==null?void 0:t.fallbackPrefix)}catch(o){rt.error(o),i=Y$}const n=a$(i,t),a=c$(l$(n.body),{...n.attributes,...r});return Hr(a,gr())},"getIconSVG");function Wb(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
257
|
+
`).replace(/\n{2,}/g,`
|
|
258
|
+
`),n=Fb(i);return t===!1?n.replace(/ /g," "):n}m(Wb,"preprocessMarkdown");function qb(e,t={}){const r=Wb(e,t),i=Oe.lexer(r),n=[[]];let a=0;function o(s,c="normal"){s.type==="text"?s.text.split(`
|
|
259
|
+
`).forEach((h,u)=>{u!==0&&(a++,n.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&n[a].push({content:f,type:c})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(l=>{o(l,s.type)}):s.type==="html"&&n[a].push({content:s.text,type:"normal"})}return m(o,"processNode"),i.forEach(s=>{var c;s.type==="paragraph"?(c=s.tokens)==null||c.forEach(l=>{o(l)}):s.type==="html"?n[a].push({content:s.text,type:"normal"}):n[a].push({content:s.raw,type:"normal"})}),n}m(qb,"markdownToLines");function Hb(e,{markdownAutoWrap:t}={}){const r=Oe.lexer(e);function i(n){var a,o,s;return n.type==="text"?t===!1?n.text.replace(/\n */g,"<br/>").replace(/ /g," "):n.text.replace(/\n */g,"<br/>"):n.type==="strong"?`<strong>${(a=n.tokens)==null?void 0:a.map(i).join("")}</strong>`:n.type==="em"?`<em>${(o=n.tokens)==null?void 0:o.map(i).join("")}</em>`:n.type==="paragraph"?`<p>${(s=n.tokens)==null?void 0:s.map(i).join("")}</p>`:n.type==="space"?"":n.type==="html"?`${n.text}`:n.type==="escape"?n.text:(rt.warn(`Unsupported markdown: ${n.type}`),n.raw)}return m(i,"output"),r.map(i).join("")}m(Hb,"markdownToHTML");function jb(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}m(jb,"splitTextToChars");function Ub(e,t){const r=jb(t.content);return Au(e,[],r,t.type)}m(Ub,"splitWordToFitWidth");function Au(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[n,...a]=r,o=[...t,n];return e([{content:o.join(""),type:i}])?Au(e,o,a,i):(t.length===0&&n&&(t.push(n),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}m(Au,"splitWordToFitWidthRecursion");function Gb(e,t){if(e.some(({content:r})=>r.includes(`
|
|
260
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Uo(e,t)}m(Gb,"splitLineToFitWidth");function Uo(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let n="";e[0].content===" "&&(n=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},o=[...i];if(n!==""&&o.push({content:n,type:"normal"}),o.push(a),t(o))return Uo(e,t,r,o);if(i.length>0)r.push(i),e.unshift(a);else if(a.content){const[s,c]=Ub(t,a);r.push([s]),c.content&&e.unshift(c)}return Uo(e,t,r)}m(Uo,"splitLineToFitWidthRecursion");function rh(e,t){t&&e.attr("style",t)}m(rh,"applyStyle");async function Yb(e,t,r,i,n=!1,a=gr()){const o=e.append("foreignObject");o.attr("width",`${10*r}px`),o.attr("height",`${10*r}px`);const s=o.append("xhtml:div"),c=ta(t.label)?await Xh(t.label.replace(sa.lineBreakRegex,`
|
|
261
|
+
`),a):Hr(t.label,a),l=t.isNode?"nodeLabel":"edgeLabel",h=s.append("span");h.html(c),rh(h,t.labelStyle),h.attr("class",`${l} ${i}`),rh(s,t.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",r+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),n&&s.attr("class","labelBkg");let u=s.node().getBoundingClientRect();return u.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),u=s.node().getBoundingClientRect()),o.node()}m(Yb,"addHtmlSpan");function kl(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}m(kl,"createTspan");function Vb(e,t,r){const i=e.append("text"),n=kl(i,1,t);wl(n,r);const a=n.node().getComputedTextLength();return i.remove(),a}m(Vb,"computeWidthOfText");function Z$(e,t,r){var o;const i=e.append("text"),n=kl(i,1,t);wl(n,[{content:r,type:"normal"}]);const a=(o=n.node())==null?void 0:o.getBoundingClientRect();return a&&i.remove(),a}m(Z$,"computeDimensionOfText");function Xb(e,t,r,i=!1){const a=t.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),s=a.append("text").attr("y","-10.1");let c=0;for(const l of r){const h=m(f=>Vb(a,1.1,f)<=e,"checkWidth"),u=h(l)?[l]:Gb(l,h);for(const f of u){const d=kl(s,c,1.1);wl(d,f),c++}}if(i){const l=s.node().getBBox(),h=2;return o.attr("x",l.x-h).attr("y",l.y-h).attr("width",l.width+2*h).attr("height",l.height+2*h),a.node()}else return s.node()}m(Xb,"createFormattedText");function wl(e,t){e.text(""),t.forEach((r,i)=>{const n=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?n.text(r.content):n.text(" "+r.content)})}m(wl,"updateTextContentAndStyles");async function Zb(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(n,a,o)=>(r.push((async()=>{const s=`${a}:${o}`;return await X$(s)?await vs(s,void 0,{class:"label-icon"}):`<i class='${Hr(n,t).replace(":"," ")}'></i>`})()),n));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}m(Zb,"replaceIconSubstring");var Ui=m(async(e,t="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:c=!1}={},l)=>{if(rt.debug("XYZ createText",t,r,i,n,a,o,"addSvgBackground: ",c),a){const h=Hb(t,l),u=await Zb(Tn(h),l),f=t.replace(/\\\\/g,"\\"),d={isNode:o,label:ta(t)?f:u,labelStyle:r.replace("fill:","color:")};return await Yb(e,d,s,n,c,l)}else{const h=t.replace(/<br\s*\/?>/g,"<br/>"),u=qb(h.replace("<br>","<br/>"),l),f=Xb(s,e,u,t?c:!1);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");se(f).attr("style",d)}else{const d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");se(f).select("rect").attr("style",d.replace(/background:/g,"fill:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");se(f).select("text").attr("style",p)}return f}},"createText");function rc(e,t,r){if(e&&e.length){const[i,n]=t,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(const c of e){const[l,h]=c;c[0]=(l-i)*o-(h-n)*s+i,c[1]=(l-i)*s+(h-n)*o+n}}}function K$(e,t){return e[0]===t[0]&&e[1]===t[1]}function Q$(e,t,r,i=1){const n=r,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(n)for(const l of o)rc(l,s,n);const c=(function(l,h,u){const f=[];for(const x of l){const C=[...x];K$(C[0],C[C.length-1])||C.push([C[0][0],C[0][1]]),C.length>2&&f.push(C)}const d=[];h=Math.max(h,.1);const p=[];for(const x of f)for(let C=0;C<x.length-1;C++){const A=x[C],B=x[C+1];if(A[1]!==B[1]){const w=Math.min(A[1],B[1]);p.push({ymin:w,ymax:Math.max(A[1],B[1]),x:w===A[1]?A[0]:B[0],islope:(B[0]-A[0])/(B[1]-A[1])})}}if(p.sort(((x,C)=>x.ymin<C.ymin?-1:x.ymin>C.ymin?1:x.x<C.x?-1:x.x>C.x?1:x.ymax===C.ymax?0:(x.ymax-C.ymax)/Math.abs(x.ymax-C.ymax))),!p.length)return d;let g=[],b=p[0].ymin,y=0;for(;g.length||p.length;){if(p.length){let x=-1;for(let C=0;C<p.length&&!(p[C].ymin>b);C++)x=C;p.splice(0,x+1).forEach((C=>{g.push({s:b,edge:C})}))}if(g=g.filter((x=>!(x.edge.ymax<=b))),g.sort(((x,C)=>x.edge.x===C.edge.x?0:(x.edge.x-C.edge.x)/Math.abs(x.edge.x-C.edge.x))),(u!==1||y%h==0)&&g.length>1)for(let x=0;x<g.length;x+=2){const C=x+1;if(C>=g.length)break;const A=g[x].edge,B=g[C].edge;d.push([[Math.round(A.x),b],[Math.round(B.x),b]])}b+=u,g.forEach((x=>{x.edge.x=x.edge.x+u*x.edge.islope})),y++}return d})(o,a,i);if(n){for(const l of o)rc(l,s,-n);(function(l,h,u){const f=[];l.forEach((d=>f.push(...d))),rc(f,h,u)})(c,s,-n)}return c}function _s(e,t){var r;const i=t.hachureAngle+90;let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=n),Q$(e,n,i,a||1)}class Mu{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=_s(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],r));return i}}function Cl(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class J$ extends Mu{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const n=_s(t,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,o=[],s=.5*i*Math.cos(a),c=.5*i*Math.sin(a);for(const[l,h]of n)Cl([l,h])&&o.push([[l[0]-s,l[1]+c],[...h]],[[l[0]+s,l[1]-c],[...h]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class tR extends Mu{fillPolygons(t,r){const i=this._fillPolygons(t,r),n=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,n);return i.ops=i.ops.concat(a.ops),i}}class eR{constructor(t){this.helper=t}fillPolygons(t,r){const i=_s(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const o=n/4;for(const s of t){const c=Cl(s),l=c/n,h=Math.ceil(l)-1,u=c-h*n,f=(s[0][0]+s[1][0])/2-n/4,d=Math.min(s[0][1],s[1][1]);for(let p=0;p<h;p++){const g=d+u+p*n,b=f-o+2*Math.random()*o,y=g-o+2*Math.random()*o,x=this.helper.ellipse(b,y,a,a,r);i.push(...x.ops)}}return{type:"fillSketch",ops:i}}}class rR{constructor(t){this.helper=t}fillPolygons(t,r){const i=_s(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,n=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((o=>{const s=Cl(o),c=Math.floor(s/(i+n)),l=(s+n-c*(i+n))/2;let h=o[0],u=o[1];h[0]>u[0]&&(h=o[1],u=o[0]);const f=Math.atan((u[1]-h[1])/(u[0]-h[0]));for(let d=0;d<c;d++){const p=d*(i+n),g=p+i,b=[h[0]+p*Math.cos(f)+l*Math.cos(f),h[1]+p*Math.sin(f)+l*Math.sin(f)],y=[h[0]+g*Math.cos(f)+l*Math.cos(f),h[1]+g*Math.sin(f)+l*Math.sin(f)];a.push(...this.helper.doubleLineOps(b[0],b[1],y[0],y[1],r))}})),a}}class iR{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,n=r.zigzagOffset<0?i:r.zigzagOffset,a=_s(t,r=Object.assign({},r,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(a,n,r)}}zigzagLines(t,r,i){const n=[];return t.forEach((a=>{const o=Cl(a),s=Math.round(o/(2*r));let c=a[0],l=a[1];c[0]>l[0]&&(c=a[1],l=a[0]);const h=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let u=0;u<s;u++){const f=2*u*r,d=2*(u+1)*r,p=Math.sqrt(2*Math.pow(r,2)),g=[c[0]+f*Math.cos(h),c[1]+f*Math.sin(h)],b=[c[0]+d*Math.cos(h),c[1]+d*Math.sin(h)],y=[g[0]+p*Math.cos(h+Math.PI/4),g[1]+p*Math.sin(h+Math.PI/4)];n.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],i),...this.helper.doubleLineOps(y[0],y[1],b[0],b[1],i))}})),n}}const Er={};class nR{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const aR=0,ic=1,Bf=2,Is={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function nc(e,t){return e.type===t}function Lu(e){const t=[],r=(function(o){const s=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))s[s.length]={type:aR,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];s[s.length]={type:ic,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return s[s.length]={type:Bf,text:""},s})(e);let i="BOD",n=0,a=r[n];for(;!nc(a,Bf);){let o=0;const s=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return Lu("M0,0"+e);n++,o=Is[a.text],i=a.text}else nc(a,ic)?o=Is[i]:(n++,o=Is[a.text],i=a.text);if(!(n+o<r.length))throw new Error("Path data ended short");for(let c=n;c<n+o;c++){const l=r[c];if(!nc(l,ic))throw new Error("Param not a number: "+i+","+l.text);s[s.length]=+l.text}if(typeof Is[i]!="number")throw new Error("Bad segment: "+i);{const c={key:i,data:s};t.push(c),n+=o,a=r[n],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Kb(e){let t=0,r=0,i=0,n=0;const a=[];for(const{key:o,data:s}of e)switch(o){case"M":a.push({key:"M",data:[...s]}),[t,r]=s,[i,n]=s;break;case"m":t+=s[0],r+=s[1],a.push({key:"M",data:[t,r]}),i=t,n=r;break;case"L":a.push({key:"L",data:[...s]}),[t,r]=s;break;case"l":t+=s[0],r+=s[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...s]}),t=s[4],r=s[5];break;case"c":{const c=s.map(((l,h)=>h%2?l+r:l+t));a.push({key:"C",data:c}),t=c[4],r=c[5];break}case"Q":a.push({key:"Q",data:[...s]}),t=s[2],r=s[3];break;case"q":{const c=s.map(((l,h)=>h%2?l+r:l+t));a.push({key:"Q",data:c}),t=c[2],r=c[3];break}case"A":a.push({key:"A",data:[...s]}),t=s[5],r=s[6];break;case"a":t+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,r]});break;case"H":a.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),t=s[2],r=s[3];break;case"s":{const c=s.map(((l,h)=>h%2?l+r:l+t));a.push({key:"S",data:c}),t=c[2],r=c[3];break}case"T":a.push({key:"T",data:[...s]}),t=s[0],r=s[1];break;case"t":t+=s[0],r+=s[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=i,r=n}return a}function Qb(e){const t=[];let r="",i=0,n=0,a=0,o=0,s=0,c=0;for(const{key:l,data:h}of e){switch(l){case"M":t.push({key:"M",data:[...h]}),[i,n]=h,[a,o]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],n=h[5],s=h[2],c=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,n]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,n]});break;case"V":n=h[0],t.push({key:"L",data:[i,n]});break;case"S":{let u=0,f=0;r==="C"||r==="S"?(u=i+(i-s),f=n+(n-c)):(u=i,f=n),t.push({key:"C",data:[u,f,...h]}),s=h[0],c=h[1],i=h[2],n=h[3];break}case"T":{const[u,f]=h;let d=0,p=0;r==="Q"||r==="T"?(d=i+(i-s),p=n+(n-c)):(d=i,p=n);const g=i+2*(d-i)/3,b=n+2*(p-n)/3,y=u+2*(d-u)/3,x=f+2*(p-f)/3;t.push({key:"C",data:[g,b,y,x,u,f]}),s=d,c=p,i=u,n=f;break}case"Q":{const[u,f,d,p]=h,g=i+2*(u-i)/3,b=n+2*(f-n)/3,y=d+2*(u-d)/3,x=p+2*(f-p)/3;t.push({key:"C",data:[g,b,y,x,d,p]}),s=u,c=f,i=d,n=p;break}case"A":{const u=Math.abs(h[0]),f=Math.abs(h[1]),d=h[2],p=h[3],g=h[4],b=h[5],y=h[6];u===0||f===0?(t.push({key:"C",data:[i,n,b,y,b,y]}),i=b,n=y):(i!==b||n!==y)&&(Jb(i,n,b,y,u,f,d,p,g).forEach((function(x){t.push({key:"C",data:x})})),i=b,n=y);break}case"Z":t.push({key:"Z",data:[]}),i=a,n=o}r=l}return t}function Ta(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Jb(e,t,r,i,n,a,o,s,c,l){const h=(u=o,Math.PI*u/180);var u;let f=[],d=0,p=0,g=0,b=0;if(l)[d,p,g,b]=l;else{[e,t]=Ta(e,t,-h),[r,i]=Ta(r,i,-h);const D=(e-r)/2,_=(t-i)/2;let T=D*D/(n*n)+_*_/(a*a);T>1&&(T=Math.sqrt(T),n*=T,a*=T);const k=n*n,S=a*a,M=k*S-k*_*_-S*D*D,W=k*_*_+S*D*D,N=(s===c?-1:1)*Math.sqrt(Math.abs(M/W));g=N*n*_/a+(e+r)/2,b=N*-a*D/n+(t+i)/2,d=Math.asin(parseFloat(((t-b)/a).toFixed(9))),p=Math.asin(parseFloat(((i-b)/a).toFixed(9))),e<g&&(d=Math.PI-d),r<g&&(p=Math.PI-p),d<0&&(d=2*Math.PI+d),p<0&&(p=2*Math.PI+p),c&&d>p&&(d-=2*Math.PI),!c&&p>d&&(p-=2*Math.PI)}let y=p-d;if(Math.abs(y)>120*Math.PI/180){const D=p,_=r,T=i;p=c&&p>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,f=Jb(r=g+n*Math.cos(p),i=b+a*Math.sin(p),_,T,n,a,o,0,c,[p,D,g,b])}y=p-d;const x=Math.cos(d),C=Math.sin(d),A=Math.cos(p),B=Math.sin(p),w=Math.tan(y/4),E=4/3*n*w,I=4/3*a*w,Y=[e,t],q=[e+E*C,t-I*x],F=[r+E*B,i-I*A],z=[r,i];if(q[0]=2*Y[0]-q[0],q[1]=2*Y[1]-q[1],l)return[q,F,z].concat(f);{f=[q,F,z].concat(f);const D=[];for(let _=0;_<f.length;_+=3){const T=Ta(f[_][0],f[_][1],h),k=Ta(f[_+1][0],f[_+1][1],h),S=Ta(f[_+2][0],f[_+2][1],h);D.push([T[0],T[1],k[0],k[1],S[0],S[1]])}return D}}const sR={randOffset:function(e,t){return Jt(e,t)},randOffsetWithRange:function(e,t,r){return Go(e,t,r)},ellipse:function(e,t,r,i,n){const a=ey(r,i,n);return ih(e,t,n,a).opset},doubleLineOps:function(e,t,r,i,n){return qi(e,t,r,i,n,!0)}};function ty(e,t,r,i,n){return{type:"path",ops:qi(e,t,r,i,n)}}function io(e,t,r){const i=(e||[]).length;if(i>2){const n=[];for(let a=0;a<i-1;a++)n.push(...qi(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&n.push(...qi(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:n}}return i===2?ty(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function oR(e,t,r,i,n){return(function(a,o){return io(a,!0,o)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],n)}function $f(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Ds(r[0],1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Ds(r[0],1.5*(1+.22*t.roughness),Nf(t));for(let a=1;a<r.length;a++){const o=r[a];if(o.length){const s=Ds(o,1*(1+.2*t.roughness),t),c=t.disableMultiStroke?[]:Ds(o,1.5*(1+.22*t.roughness),Nf(t));for(const l of s)l.op!=="move"&&i.push(l);for(const l of c)l.op!=="move"&&n.push(l)}}return{type:"path",ops:i.concat(n)}}return{type:"path",ops:[]}}function ey(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/n;let o=Math.abs(e/2),s=Math.abs(t/2);const c=1-r.curveFitting;return o+=Jt(o*c,r),s+=Jt(s*c,r),{increment:a,rx:o,ry:s}}function ih(e,t,r,i){const[n,a]=If(i.increment,e,t,i.rx,i.ry,1,i.increment*Go(.1,Go(.4,1,r),r),r);let o=Yo(n,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[s]=If(i.increment,e,t,i.rx,i.ry,1.5,0,r),c=Yo(s,null,r);o=o.concat(c)}return{estimatedPoints:a,opset:{type:"path",ops:o}}}function Rf(e,t,r,i,n,a,o,s,c){const l=e,h=t;let u=Math.abs(r/2),f=Math.abs(i/2);u+=Jt(.01*u,c),f+=Jt(.01*f,c);let d=n,p=a;for(;d<0;)d+=2*Math.PI,p+=2*Math.PI;p-d>2*Math.PI&&(d=0,p=2*Math.PI);const g=2*Math.PI/c.curveStepCount,b=Math.min(g/2,(p-d)/2),y=Df(b,l,h,u,f,d,p,1,c);if(!c.disableMultiStroke){const x=Df(b,l,h,u,f,d,p,1.5,c);y.push(...x)}return o&&(s?y.push(...qi(l,h,l+u*Math.cos(d),h+f*Math.sin(d),c),...qi(l,h,l+u*Math.cos(p),h+f*Math.sin(p),c)):y.push({op:"lineTo",data:[l,h]},{op:"lineTo",data:[l+u*Math.cos(d),h+f*Math.sin(d)]})),{type:"path",ops:y}}function Of(e,t){const r=Qb(Kb(Lu(e))),i=[];let n=[0,0],a=[0,0];for(const{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],n=[s[0],s[1]];break;case"L":i.push(...qi(a[0],a[1],s[0],s[1],t)),a=[s[0],s[1]];break;case"C":{const[c,l,h,u,f,d]=s;i.push(...lR(c,l,h,u,f,d,a,t)),a=[f,d];break}case"Z":i.push(...qi(a[0],a[1],n[0],n[1],t)),a=[n[0],n[1]]}return{type:"path",ops:i}}function ac(e,t){const r=[];for(const i of e)if(i.length){const n=t.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+Jt(n,t),i[0][1]+Jt(n,t)]});for(let o=1;o<a;o++)r.push({op:"lineTo",data:[i[o][0]+Jt(n,t),i[o][1]+Jt(n,t)]})}}return{type:"fillPath",ops:r}}function Mn(e,t){return(function(r,i){let n=r.fillStyle||"hachure";if(!Er[n])switch(n){case"zigzag":Er[n]||(Er[n]=new J$(i));break;case"cross-hatch":Er[n]||(Er[n]=new tR(i));break;case"dots":Er[n]||(Er[n]=new eR(i));break;case"dashed":Er[n]||(Er[n]=new rR(i));break;case"zigzag-line":Er[n]||(Er[n]=new iR(i));break;default:n="hachure",Er[n]||(Er[n]=new Mu(i))}return Er[n]})(t,sR).fillPolygons(e,t)}function Nf(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function ry(e){return e.randomizer||(e.randomizer=new nR(e.seed||0)),e.randomizer.next()}function Go(e,t,r,i=1){return r.roughness*i*(ry(r)*(t-e)+e)}function Jt(e,t,r=1){return Go(-e,e,t,r)}function qi(e,t,r,i,n,a=!1){const o=a?n.disableMultiStrokeFill:n.disableMultiStroke,s=nh(e,t,r,i,n,!0,!1);if(o)return s;const c=nh(e,t,r,i,n,!0,!0);return s.concat(c)}function nh(e,t,r,i,n,a,o){const s=Math.pow(e-r,2)+Math.pow(t-i,2),c=Math.sqrt(s);let l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let h=n.maxRandomnessOffset||0;h*h*100>s&&(h=c/10);const u=h/2,f=.2+.2*ry(n);let d=n.bowing*n.maxRandomnessOffset*(i-t)/200,p=n.bowing*n.maxRandomnessOffset*(e-r)/200;d=Jt(d,n,l),p=Jt(p,n,l);const g=[],b=()=>Jt(u,n,l),y=()=>Jt(h,n,l),x=n.preserveVertices;return o?g.push({op:"move",data:[e+(x?0:b()),t+(x?0:b())]}):g.push({op:"move",data:[e+(x?0:Jt(h,n,l)),t+(x?0:Jt(h,n,l))]}),o?g.push({op:"bcurveTo",data:[d+e+(r-e)*f+b(),p+t+(i-t)*f+b(),d+e+2*(r-e)*f+b(),p+t+2*(i-t)*f+b(),r+(x?0:b()),i+(x?0:b())]}):g.push({op:"bcurveTo",data:[d+e+(r-e)*f+y(),p+t+(i-t)*f+y(),d+e+2*(r-e)*f+y(),p+t+2*(i-t)*f+y(),r+(x?0:y()),i+(x?0:y())]}),g}function Ds(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+Jt(t,r),e[0][1]+Jt(t,r)]),i.push([e[0][0]+Jt(t,r),e[0][1]+Jt(t,r)]);for(let n=1;n<e.length;n++)i.push([e[n][0]+Jt(t,r),e[n][1]+Jt(t,r)]),n===e.length-1&&i.push([e[n][0]+Jt(t,r),e[n][1]+Jt(t,r)]);return Yo(i,null,r)}function Yo(e,t,r){const i=e.length,n=[];if(i>3){const a=[],o=1-r.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+2<i;s++){const c=e[s];a[0]=[c[0],c[1]],a[1]=[c[0]+(o*e[s+1][0]-o*e[s-1][0])/6,c[1]+(o*e[s+1][1]-o*e[s-1][1])/6],a[2]=[e[s+1][0]+(o*e[s][0]-o*e[s+2][0])/6,e[s+1][1]+(o*e[s][1]-o*e[s+2][1])/6],a[3]=[e[s+1][0],e[s+1][1]],n.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else i===3?(n.push({op:"move",data:[e[1][0],e[1][1]]}),n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&n.push(...nh(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return n}function If(e,t,r,i,n,a,o,s){const c=[],l=[];if(s.roughness===0){e/=4,l.push([t+i*Math.cos(-e),r+n*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const u=[t+i*Math.cos(h),r+n*Math.sin(h)];c.push(u),l.push(u)}l.push([t+i*Math.cos(0),r+n*Math.sin(0)]),l.push([t+i*Math.cos(e),r+n*Math.sin(e)])}else{const h=Jt(.5,s)-Math.PI/2;l.push([Jt(a,s)+t+.9*i*Math.cos(h-e),Jt(a,s)+r+.9*n*Math.sin(h-e)]);const u=2*Math.PI+h-.01;for(let f=h;f<u;f+=e){const d=[Jt(a,s)+t+i*Math.cos(f),Jt(a,s)+r+n*Math.sin(f)];c.push(d),l.push(d)}l.push([Jt(a,s)+t+i*Math.cos(h+2*Math.PI+.5*o),Jt(a,s)+r+n*Math.sin(h+2*Math.PI+.5*o)]),l.push([Jt(a,s)+t+.98*i*Math.cos(h+o),Jt(a,s)+r+.98*n*Math.sin(h+o)]),l.push([Jt(a,s)+t+.9*i*Math.cos(h+.5*o),Jt(a,s)+r+.9*n*Math.sin(h+.5*o)])}return[l,c]}function Df(e,t,r,i,n,a,o,s,c){const l=a+Jt(.1,c),h=[];h.push([Jt(s,c)+t+.9*i*Math.cos(l-e),Jt(s,c)+r+.9*n*Math.sin(l-e)]);for(let u=l;u<=o;u+=e)h.push([Jt(s,c)+t+i*Math.cos(u),Jt(s,c)+r+n*Math.sin(u)]);return h.push([t+i*Math.cos(o),r+n*Math.sin(o)]),h.push([t+i*Math.cos(o),r+n*Math.sin(o)]),Yo(h,null,c)}function lR(e,t,r,i,n,a,o,s){const c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let h=[0,0];const u=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let d=0;d<u;d++)d===0?c.push({op:"move",data:[o[0],o[1]]}):c.push({op:"move",data:[o[0]+(f?0:Jt(l[0],s)),o[1]+(f?0:Jt(l[0],s))]}),h=f?[n,a]:[n+Jt(l[d],s),a+Jt(l[d],s)],c.push({op:"bcurveTo",data:[e+Jt(l[d],s),t+Jt(l[d],s),r+Jt(l[d],s),i+Jt(l[d],s),h[0],h[1]]});return c}function Ea(e){return[...e]}function Ff(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ea(e[0]),Ea(e[1]),Ea(e[2]),Ea(e[2]));else{const n=[];n.push(e[0],e[0]);for(let s=1;s<e.length;s++)n.push(e[s]),s===e.length-1&&n.push(e[s]);const a=[],o=1-t;i.push(Ea(n[0]));for(let s=1;s+2<n.length;s++){const c=n[s];a[0]=[c[0],c[1]],a[1]=[c[0]+(o*n[s+1][0]-o*n[s-1][0])/6,c[1]+(o*n[s+1][1]-o*n[s-1][1])/6],a[2]=[n[s+1][0]+(o*n[s][0]-o*n[s+2][0])/6,n[s+1][1]+(o*n[s][1]-o*n[s+2][1])/6],a[3]=[n[s+1][0],n[s+1][1]],i.push(a[1],a[2],a[3])}}return i}function no(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function cR(e,t,r){const i=no(t,r);if(i===0)return no(e,t);let n=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return n=Math.max(0,Math.min(1,n)),no(e,rn(t,r,n))}function rn(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function ah(e,t,r,i){const n=i||[];if((function(s,c){const l=s[c+0],h=s[c+1],u=s[c+2],f=s[c+3];let d=3*h[0]-2*l[0]-f[0];d*=d;let p=3*h[1]-2*l[1]-f[1];p*=p;let g=3*u[0]-2*f[0]-l[0];g*=g;let b=3*u[1]-2*f[1]-l[1];return b*=b,d<g&&(d=g),p<b&&(p=b),d+p})(e,t)<r){const s=e[t+0];n.length?(a=n[n.length-1],o=s,Math.sqrt(no(a,o))>1&&n.push(s)):n.push(s),n.push(e[t+3])}else{const c=e[t+0],l=e[t+1],h=e[t+2],u=e[t+3],f=rn(c,l,.5),d=rn(l,h,.5),p=rn(h,u,.5),g=rn(f,d,.5),b=rn(d,p,.5),y=rn(g,b,.5);ah([c,f,g,y],0,r,n),ah([y,b,p,u],0,r,n)}var a,o;return n}function hR(e,t){return Vo(e,0,e.length,t)}function Vo(e,t,r,i,n){const a=n||[],o=e[t],s=e[r-1];let c=0,l=1;for(let h=t+1;h<r-1;++h){const u=cR(e[h],o,s);u>c&&(c=u,l=h)}return Math.sqrt(c)>i?(Vo(e,t,l+1,i,a),Vo(e,l,r,i,a)):(a.length||a.push(o),a.push(s)),a}function sc(e,t=.15,r){const i=[],n=(e.length-1)/3;for(let a=0;a<n;a++)ah(e,3*a,t,i);return r&&r>0?Vo(i,0,i.length,r):i}const Rr="none";class Xo{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,n,a){const o=this._o(a);return this._d("line",[ty(t,r,i,n,o)],o)}rectangle(t,r,i,n,a){const o=this._o(a),s=[],c=oR(t,r,i,n,o);if(o.fill){const l=[[t,r],[t+i,r],[t+i,r+n],[t,r+n]];o.fillStyle==="solid"?s.push(ac([l],o)):s.push(Mn([l],o))}return o.stroke!==Rr&&s.push(c),this._d("rectangle",s,o)}ellipse(t,r,i,n,a){const o=this._o(a),s=[],c=ey(i,n,o),l=ih(t,r,o,c);if(o.fill)if(o.fillStyle==="solid"){const h=ih(t,r,o,c).opset;h.type="fillPath",s.push(h)}else s.push(Mn([l.estimatedPoints],o));return o.stroke!==Rr&&s.push(l.opset),this._d("ellipse",s,o)}circle(t,r,i,n){const a=this.ellipse(t,r,i,i,n);return a.shape="circle",a}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[io(t,!1,i)],i)}arc(t,r,i,n,a,o,s=!1,c){const l=this._o(c),h=[],u=Rf(t,r,i,n,a,o,s,!0,l);if(s&&l.fill)if(l.fillStyle==="solid"){const f=Object.assign({},l);f.disableMultiStroke=!0;const d=Rf(t,r,i,n,a,o,!0,!1,f);d.type="fillPath",h.push(d)}else h.push((function(f,d,p,g,b,y,x){const C=f,A=d;let B=Math.abs(p/2),w=Math.abs(g/2);B+=Jt(.01*B,x),w+=Jt(.01*w,x);let E=b,I=y;for(;E<0;)E+=2*Math.PI,I+=2*Math.PI;I-E>2*Math.PI&&(E=0,I=2*Math.PI);const Y=(I-E)/x.curveStepCount,q=[];for(let F=E;F<=I;F+=Y)q.push([C+B*Math.cos(F),A+w*Math.sin(F)]);return q.push([C+B*Math.cos(I),A+w*Math.sin(I)]),q.push([C,A]),Mn([q],x)})(t,r,i,n,a,o,l));return l.stroke!==Rr&&h.push(u),this._d("arc",h,l)}curve(t,r){const i=this._o(r),n=[],a=$f(t,i);if(i.fill&&i.fill!==Rr)if(i.fillStyle==="solid"){const o=$f(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],s=t;if(s.length){const c=typeof s[0][0]=="number"?[s]:s;for(const l of c)l.length<3?o.push(...l):l.length===3?o.push(...sc(Ff([l[0],l[0],l[1],l[2]]),10,(1+i.roughness)/2)):o.push(...sc(Ff(l),10,(1+i.roughness)/2))}o.length&&n.push(Mn([o],i))}return i.stroke!==Rr&&n.push(a),this._d("curve",n,i)}polygon(t,r){const i=this._o(r),n=[],a=io(t,!0,i);return i.fill&&(i.fillStyle==="solid"?n.push(ac([t],i)):n.push(Mn([t],i))),i.stroke!==Rr&&n.push(a),this._d("polygon",n,i)}path(t,r){const i=this._o(r),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=i.fill&&i.fill!=="transparent"&&i.fill!==Rr,o=i.stroke!==Rr,s=!!(i.simplification&&i.simplification<1),c=(function(h,u,f){const d=Qb(Kb(Lu(h))),p=[];let g=[],b=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...sc(y,u)),y=[]},C=()=>{x(),g.length&&(p.push(g),g=[])};for(const{key:B,data:w}of d)switch(B){case"M":C(),b=[w[0],w[1]],g.push(b);break;case"L":x(),g.push([w[0],w[1]]);break;case"C":if(!y.length){const E=g.length?g[g.length-1]:b;y.push([E[0],E[1]])}y.push([w[0],w[1]]),y.push([w[2],w[3]]),y.push([w[4],w[5]]);break;case"Z":x(),g.push([b[0],b[1]])}if(C(),!f)return p;const A=[];for(const B of p){const w=hR(B,f);w.length&&A.push(w)}return A})(t,1,s?4-4*(i.simplification||1):(1+i.roughness)/2),l=Of(t,i);if(a)if(i.fillStyle==="solid")if(c.length===1){const h=Of(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else n.push(ac(c,i));else n.push(Mn(c,i));return o&&(s?c.forEach((h=>{n.push(io(h,!1,i))})):n.push(l)),this._d("path",n,i)}opsToPath(t,r){let i="";for(const n of t.ops){const a=typeof r=="number"&&r>=0?n.data.map((o=>+o.toFixed(r))):n.data;switch(n.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const a of r){let o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Rr};break;case"fillPath":o={d:this.opsToPath(a),stroke:Rr,strokeWidth:0,fill:i.fill||Rr};break;case"fillSketch":o=this.fillSketch(a,i)}o&&n.push(o)}return n}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Rr,strokeWidth:i,fill:Rr}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class uR{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Xo(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.type){case"path":n.save(),n.strokeStyle=i.stroke==="none"?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,o,a),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,o,a,s),n.restore();break}case"fillSketch":this.fillSketch(n,o,i)}}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,n="nonzero"){t.beginPath();for(const a of r.ops){const o=typeof i=="number"&&i>=0?a.data.map((s=>+s.toFixed(i))):a.data;switch(a.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}r.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,n,a){const o=this.gen.line(t,r,i,n,a);return this.draw(o),o}rectangle(t,r,i,n,a){const o=this.gen.rectangle(t,r,i,n,a);return this.draw(o),o}ellipse(t,r,i,n,a){const o=this.gen.ellipse(t,r,i,n,a);return this.draw(o),o}circle(t,r,i,n){const a=this.gen.circle(t,r,i,n);return this.draw(a),a}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,n,a,o,s=!1,c){const l=this.gen.arc(t,r,i,n,a,o,s,c);return this.draw(l),l}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Fs="http://www.w3.org/2000/svg";class dR{constructor(t,r){this.svg=t,this.gen=new Xo(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,a=n.createElementNS(Fs,"g"),o=t.options.fixedDecimalPlaceDigits;for(const s of r){let c=null;switch(s.type){case"path":c=n.createElementNS(Fs,"path"),c.setAttribute("d",this.opsToPath(s,o)),c.setAttribute("stroke",i.stroke),c.setAttribute("stroke-width",i.strokeWidth+""),c.setAttribute("fill","none"),i.strokeLineDash&&c.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":c=n.createElementNS(Fs,"path"),c.setAttribute("d",this.opsToPath(s,o)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||c.setAttribute("fill-rule","evenodd");break;case"fillSketch":c=this.fillSketch(n,s,i)}c&&a.appendChild(c)}return a}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);const a=t.createElementNS(Fs,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",n+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,n,a){const o=this.gen.line(t,r,i,n,a);return this.draw(o)}rectangle(t,r,i,n,a){const o=this.gen.rectangle(t,r,i,n,a);return this.draw(o)}ellipse(t,r,i,n,a){const o=this.gen.ellipse(t,r,i,n,a);return this.draw(o)}circle(t,r,i,n){const a=this.gen.circle(t,r,i,n);return this.draw(a)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,n,a,o,s=!1,c){const l=this.gen.arc(t,r,i,n,a,o,s,c);return this.draw(l)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var $t={canvas:(e,t)=>new uR(e,t),svg:(e,t)=>new dR(e,t),generator:e=>new Xo(e),newSeed:()=>Xo.newSeed()},Xt=m(async(e,t,r)=>{var u,f;let i;const n=t.useHtmlLabels||nr((u=Re())==null?void 0:u.htmlLabels);r?i=r:i="node default";const a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",br(t.labelStyle));let s;t.label===void 0?s="":s=typeof t.label=="string"?t.label:t.label[0];const c=await Ui(o,Hr(Tn(s),Re()),{useHtmlLabels:n,width:t.width||((f=Re().flowchart)==null?void 0:f.wrappingWidth),cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let l=c.getBBox();const h=((t==null?void 0:t.padding)??0)/2;if(n){const d=c.children[0],p=se(c),g=d.getElementsByTagName("img");if(g){const b=s.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...g].map(y=>new Promise(x=>{function C(){if(y.style.display="flex",y.style.flexDirection="column",b){const A=Re().fontSize?Re().fontSize:window.getComputedStyle(document.body).fontSize,B=5,[w=um.fontSize]=xl(A),E=w*B+"px";y.style.minWidth=E,y.style.maxWidth=E}else y.style.width="100%";x(y)}m(C,"setupImage"),setTimeout(()=>{y.complete&&C()}),y.addEventListener("error",C),y.addEventListener("load",C)})))}l=d.getBoundingClientRect(),p.attr("width",l.width),p.attr("height",l.height)}return n?o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"):o.attr("transform","translate(0, "+-l.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:l,halfPadding:h,label:o}},"labelHelper"),oc=m(async(e,t,r)=>{var c,l,h,u,f,d;const i=r.useHtmlLabels||nr((l=(c=Re())==null?void 0:c.flowchart)==null?void 0:l.htmlLabels),n=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Ui(n,Hr(Tn(t),Re()),{useHtmlLabels:i,width:r.width||((u=(h=Re())==null?void 0:h.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=a.getBBox();const s=r.padding/2;if(nr((d=(f=Re())==null?void 0:f.flowchart)==null?void 0:d.htmlLabels)){const p=a.children[0],g=se(a);o=p.getBoundingClientRect(),g.attr("width",o.width),g.attr("height",o.height)}return i?n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):n.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:e,bbox:o,halfPadding:s,label:n}},"insertLabel"),It=m((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),Vt=m((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function ke(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}m(ke,"createPathFromPoints");function Hi(e,t,r,i,n,a){const o=[],c=r-e,l=i-t,h=c/a,u=2*Math.PI/h,f=t+l/2;for(let d=0;d<=50;d++){const p=d/50,g=e+p*c,b=f+n*Math.sin(u*(g-e));o.push({x:g,y:b})}return o}m(Hi,"generateFullSineWavePoints");function ls(e,t,r,i,n,a){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;u<i;u++){const f=s+u*h,d=e+r*Math.cos(f),p=t+r*Math.sin(f);o.push({x:-d,y:-p})}return o}m(ls,"generateCirclePoints");var fR=m((e,t)=>{var r=e.x,i=e.y,n=t.x-r,a=t.y-i,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(n)*s?(a<0&&(s=-s),c=a===0?0:s*n/a,l=s):(n<0&&(o=-o),c=o,l=n===0?0:o*a/n),{x:r+c,y:i+l}},"intersectRect"),ha=fR;function iy(e,t){t&&e.attr("style",t)}m(iy,"applyStyle");async function ny(e){const t=se(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),i=Re();let n=e.label;e.label&&ta(e.label)&&(n=await Xh(e.label.replace(sa.lineBreakRegex,`
|
|
262
|
+
`),i));const o='<span class="'+(e.isNode?"nodeLabel":"edgeLabel")+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+n+"</span>";return r.html(Hr(o,i)),iy(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}m(ny,"addHtmlLabel");var pR=m(async(e,t,r,i)=>{let n=e||"";if(typeof n=="object"&&(n=n[0]),nr(Re().flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"<br />"),rt.info("vertexText"+n);const a={isNode:i,label:Tn(n).replace(/fa[blrs]?:fa-[\w-]+/g,s=>`<i class='${s.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await ny(a)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",t.replace("color:","fill:"));let o=[];typeof n=="string"?o=n.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(n)?o=n:o=[];for(const s of o){const c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),r?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=s.trim(),a.appendChild(c)}return a}},"createLabel"),hn=pR,Gi=m((e,t,r,i,n)=>["M",e+n,t,"H",e+r-n,"A",n,n,0,0,1,e+r,t+n,"V",t+i-n,"A",n,n,0,0,1,e+r-n,t+i,"H",e+n,"A",n,n,0,0,1,e,t+i-n,"V",t+n,"A",n,n,0,0,1,e+n,t,"Z"].join(" "),"createRoundedRectPathD"),ay=m(async(e,t)=>{rt.info("Creating subgraph rect for ",t.id,t);const r=Re(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:o}=i,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:h}=Ot(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=nr(r.flowchart.htmlLabels),d=u.insert("g").attr("class","cluster-label "),p=await Ui(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0});let g=p.getBBox();if(nr(r.flowchart.htmlLabels)){const E=p.children[0],I=se(p);g=E.getBoundingClientRect(),I.attr("width",g.width),I.attr("height",g.height)}const b=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,x=t.x-b/2,C=t.y-y/2;rt.trace("Data ",t,JSON.stringify(t));let A;if(t.look==="handDrawn"){const E=$t.svg(u),I=Rt(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:n}),Y=E.path(Gi(x,C,b,y,0),I);A=u.insert(()=>(rt.debug("Rough node insert CXC",Y),Y),":first-child"),A.select("path:nth-child(2)").attr("style",l.join(";")),A.select("path").attr("style",h.join(";").replace("fill","stroke"))}else A=u.insert("rect",":first-child"),A.attr("style",c).attr("rx",t.rx).attr("ry",t.ry).attr("x",x).attr("y",C).attr("width",b).attr("height",y);const{subGraphTitleTopMargin:B}=lu(r);if(d.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+B})`),s){const E=d.select("span");E&&E.attr("style",s)}const w=A.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=g.height-t.padding/2,t.intersect=function(E){return ha(t,E)},{cluster:u,labelBBox:g}},"rect"),gR=m((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),i=r.insert("rect",":first-child"),n=0*t.padding,a=n/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+n).attr("height",t.height+n).attr("fill","none");const o=i.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(s){return ha(t,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),mR=m(async(e,t)=>{const r=Re(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:c}=i,l=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),h=l.insert("g",":first-child"),u=l.insert("g").attr("class","cluster-label");let f=l.append("rect");const d=u.node().appendChild(await hn(t.label,t.labelStyle,void 0,!0));let p=d.getBBox();if(nr(r.flowchart.htmlLabels)){const Y=d.children[0],q=se(d);p=Y.getBoundingClientRect(),q.attr("width",p.width),q.attr("height",p.height)}const g=0*t.padding,b=g/2,y=(t.width<=p.width+t.padding?p.width+t.padding:t.width)+g;t.width<=p.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height+g,C=t.height+g-p.height-6,A=t.x-y/2,B=t.y-x/2;t.width=y;const w=t.y-t.height/2-b+p.height+2;let E;if(t.look==="handDrawn"){const Y=t.cssClasses.includes("statediagram-cluster-alt"),q=$t.svg(l),F=t.rx||t.ry?q.path(Gi(A,B,y,x,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:c,seed:n}):q.rectangle(A,B,y,x,{seed:n});E=l.insert(()=>F,":first-child");const z=q.rectangle(A,w,y,C,{fill:Y?a:o,fillStyle:Y?"hachure":"solid",stroke:c,seed:n});E=l.insert(()=>F,":first-child"),f=l.insert(()=>z)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",A).attr("y",B).attr("width",y).attr("height",x).attr("data-look",t.look),f.attr("class","inner").attr("x",A).attr("y",w).attr("width",y).attr("height",C);u.attr("transform",`translate(${t.x-p.width/2}, ${B+1-(nr(r.flowchart.htmlLabels)?0:3)})`);const I=E.node().getBBox();return t.height=I.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(Y){return ha(t,Y)},{cluster:l,labelBBox:p}},"roundedWithTitle"),bR=m(async(e,t)=>{rt.info("Creating subgraph rect for ",t.id,t);const r=Re(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:o}=i,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:h}=Ot(t),u=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),f=nr(r.flowchart.htmlLabels),d=u.insert("g").attr("class","cluster-label "),p=await Ui(d,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let g=p.getBBox();if(nr(r.flowchart.htmlLabels)){const E=p.children[0],I=se(p);g=E.getBoundingClientRect(),I.attr("width",g.width),I.attr("height",g.height)}const b=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,x=t.x-b/2,C=t.y-y/2;rt.trace("Data ",t,JSON.stringify(t));let A;if(t.look==="handDrawn"){const E=$t.svg(u),I=Rt(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:n}),Y=E.path(Gi(x,C,b,y,t.rx),I);A=u.insert(()=>(rt.debug("Rough node insert CXC",Y),Y),":first-child"),A.select("path:nth-child(2)").attr("style",l.join(";")),A.select("path").attr("style",h.join(";").replace("fill","stroke"))}else A=u.insert("rect",":first-child"),A.attr("style",c).attr("rx",t.rx).attr("ry",t.ry).attr("x",x).attr("y",C).attr("width",b).attr("height",y);const{subGraphTitleTopMargin:B}=lu(r);if(d.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+B})`),s){const E=d.select("span");E&&E.attr("style",s)}const w=A.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=g.height-t.padding/2,t.intersect=function(E){return ha(t,E)},{cluster:u,labelBBox:g}},"kanbanSection"),yR=m((e,t)=>{const r=Re(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:a}=i,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),s=o.insert("g",":first-child"),c=0*t.padding,l=t.width+c;t.diff=-t.padding;const h=t.height+c,u=t.x-l/2,f=t.y-h/2;t.width=l;let d;if(t.look==="handDrawn"){const b=$t.svg(o).rectangle(u,f,l,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:n});d=o.insert(()=>b,":first-child")}else d=s.insert("rect",":first-child"),d.attr("class","divider").attr("x",u).attr("y",f).attr("width",l).attr("height",h).attr("data-look",t.look);const p=d.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(g){return ha(t,g)},{cluster:o,labelBBox:{}}},"divider"),xR=ay,vR={rect:ay,squareRect:xR,roundedWithTitle:mR,noteGroup:gR,divider:yR,kanbanSection:bR},sy=new Map,_R=m(async(e,t)=>{const r=t.shape||"rect",i=await vR[r](e,t);return sy.set(t.id,i),i},"insertCluster"),ID=m(()=>{sy=new Map},"clear");function oy(e,t){return e.intersect(t)}m(oy,"intersectNode");var kR=oy;function ly(e,t,r,i){var n=e.x,a=e.y,o=n-i.x,s=a-i.y,c=Math.sqrt(t*t*s*s+r*r*o*o),l=Math.abs(t*r*o/c);i.x<n&&(l=-l);var h=Math.abs(t*r*s/c);return i.y<a&&(h=-h),{x:n+l,y:a+h}}m(ly,"intersectEllipse");var cy=ly;function hy(e,t,r){return cy(e,t,t,r)}m(hy,"intersectCircle");var wR=hy;function uy(e,t,r,i){{const n=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=n*r.x+a*r.y+o,c=n*i.x+a*i.y+o,l=1e-6;if(s!==0&&c!==0&&sh(s,c))return;const h=i.y-r.y,u=r.x-i.x,f=i.x*r.y-r.x*i.y,d=h*e.x+u*e.y+f,p=h*t.x+u*t.y+f;if(Math.abs(d)<l&&Math.abs(p)<l&&sh(d,p))return;const g=n*u-h*a;if(g===0)return;const b=Math.abs(g/2);let y=a*f-u*o;const x=y<0?(y-b)/g:(y+b)/g;y=h*o-n*f;const C=y<0?(y-b)/g:(y+b)/g;return{x,y:C}}}m(uy,"intersectLine");function sh(e,t){return e*t>0}m(sh,"sameSign");var CR=uy;function dy(e,t,r){let i=e.x,n=e.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){o=Math.min(o,h.x),s=Math.min(s,h.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=i-e.width/2-o,l=n-e.height/2-s;for(let h=0;h<t.length;h++){let u=t[h],f=t[h<t.length-1?h+1:0],d=CR(e,r,{x:c+u.x,y:l+u.y},{x:c+f.x,y:l+f.y});d&&a.push(d)}return a.length?(a.length>1&&a.sort(function(h,u){let f=h.x-r.x,d=h.y-r.y,p=Math.sqrt(f*f+d*d),g=u.x-r.x,b=u.y-r.y,y=Math.sqrt(g*g+b*b);return p<y?-1:p===y?0:1}),a[0]):e}m(dy,"intersectPolygon");var SR=dy,vt={node:kR,circle:wR,ellipse:cy,polygon:SR,rect:ha};function fy(e,t){const{labelStyles:r}=Ot(t);t.labelStyle=r;const i=Vt(t);let n=i;i||(n="anchor");const a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=1,{cssStyles:s}=t,c=$t.svg(a),l=Rt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(l.roughness=0);const h=c.circle(0,0,o*2,l),u=a.insert(()=>h,":first-child");return u.attr("class","anchor").attr("style",br(s)),It(t,u),t.intersect=function(f){return rt.info("Circle intersect",t,o,f),vt.circle(t,o,f)},a}m(fy,"anchor");function oh(e,t,r,i,n,a,o){const c=(e+r)/2,l=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,f=(i-t)/2,d=u/n,p=f/a,g=Math.sqrt(d**2+p**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");const b=Math.sqrt(1-g**2),y=c+b*a*Math.sin(h)*(o?-1:1),x=l-b*n*Math.cos(h)*(o?-1:1),C=Math.atan2((t-x)/a,(e-y)/n);let B=Math.atan2((i-x)/a,(r-y)/n)-C;o&&B<0&&(B+=2*Math.PI),!o&&B>0&&(B-=2*Math.PI);const w=[];for(let E=0;E<20;E++){const I=E/19,Y=C+I*B,q=y+n*Math.cos(Y),F=x+a*Math.sin(Y);w.push({x:q,y:F})}return w}m(oh,"generateArcPoints");async function py(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=a.width+t.padding+20,s=a.height+t.padding,c=s/2,l=c/(2.5+s/50),{cssStyles:h}=t,u=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...oh(-o/2,-s/2,-o/2,s/2,l,c,!1),{x:o/2,y:s/2},...oh(o/2,s/2,o/2,-s/2,l,c,!0)],f=$t.svg(n),d=Rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=ke(u),g=f.path(p,d),b=n.insert(()=>g,":first-child");return b.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${l/2}, 0)`),It(t,b),t.intersect=function(y){return vt.polygon(t,u,y)},n}m(py,"bowTieRect");function Yi(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}m(Yi,"insertPolygonShape");async function gy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=a.height+t.padding,s=12,c=a.width+t.padding+s,l=0,h=c,u=-o,f=0,d=[{x:l+s,y:u},{x:h,y:u},{x:h,y:f},{x:l,y:f},{x:l,y:u+s},{x:l+s,y:u}];let p;const{cssStyles:g}=t;if(t.look==="handDrawn"){const b=$t.svg(n),y=Rt(t,{}),x=ke(d),C=b.path(x,y);p=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${o/2})`),g&&p.attr("style",g)}else p=Yi(n,c,o,d);return i&&p.attr("style",i),It(t,p),t.intersect=function(b){return vt.polygon(t,d,b)},n}m(gy,"card");function my(e,t){const{nodeStyles:r}=Ot(t);t.label="";const i=e.insert("g").attr("class",Vt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=$t.svg(i),c=Rt(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const l=ke(o),h=s.path(l,c),u=i.insert(()=>h,":first-child");return n&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return vt.polygon(t,o,f)},i}m(my,"choice");async function Bu(e,t,r){const{labelStyles:i,nodeStyles:n}=Ot(t);t.labelStyle=i;const{shapeSvg:a,bbox:o,halfPadding:s}=await Xt(e,t,Vt(t)),c=(r==null?void 0:r.padding)??s,l=o.width/2+c;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=$t.svg(a),d=Rt(t,{}),p=f.circle(0,0,l*2,d);h=a.insert(()=>p,":first-child"),h.attr("class","basic label-container").attr("style",br(u))}else h=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0);return It(t,h),t.calcIntersect=function(f,d){const p=f.width/2;return vt.circle(f,p,d)},t.intersect=function(f){return rt.info("Circle intersect",t,l,f),vt.circle(t,l,f)},a}m(Bu,"circle");function by(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,n={x:i/2*t,y:i/2*r},a={x:-(i/2)*t,y:i/2*r},o={x:-(i/2)*t,y:-(i/2)*r},s={x:i/2*t,y:-(i/2)*r};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
263
|
+
M ${n.x},${n.y} L ${o.x},${o.y}`}m(by,"createLine");function yy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r,t.label="";const n=e.insert("g").attr("class",Vt(t)).attr("id",t.domId??t.id),a=Math.max(30,(t==null?void 0:t.width)??0),{cssStyles:o}=t,s=$t.svg(n),c=Rt(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const l=s.circle(0,0,a*2,c),h=by(a),u=s.path(h,c),f=n.insert(()=>l,":first-child");return f.insert(()=>u),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),It(t,f),t.intersect=function(d){return rt.info("crossedCircle intersect",t,{radius:a,point:d}),vt.circle(t,a,d)},n}m(yy,"crossedCircle");function ki(e,t,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;u<i;u++){const f=s+u*h,d=e+r*Math.cos(f),p=t+r*Math.sin(f);o.push({x:-d,y:-p})}return o}m(ki,"generateCirclePoints");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:h}=t,u=[...ki(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...ki(s/2+l*2,-l,l,20,-180,-270),...ki(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...ki(s/2,c/2,l,20,0,90)],f=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...ki(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...ki(s/2+s*.1,-l,l,20,-180,-270),...ki(s/2+s*.1,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...ki(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2,y:c/2+l}],d=$t.svg(n),p=Rt(t,{fill:"none"});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const b=ke(u).replace("Z",""),y=d.path(b,p),x=ke(f),C=d.path(x,{...p}),A=n.insert("g",":first-child");return A.insert(()=>C,":first-child").attr("stroke-opacity",0),A.insert(()=>y,":first-child"),A.attr("class","text"),h&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(${l}, 0)`),o.attr("transform",`translate(${-s/2+l-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),It(t,A),t.intersect=function(B){return vt.polygon(t,f,B)},n}m(xy,"curlyBraceLeft");function wi(e,t,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;u<i;u++){const f=s+u*h,d=e+r*Math.cos(f),p=t+r*Math.sin(f);o.push({x:d,y:p})}return o}m(wi,"generateCirclePoints");async function vy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:h}=t,u=[...wi(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...wi(s/2+l*2,-l,l,20,-180,-270),...wi(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...wi(s/2,c/2,l,20,0,90)],f=[{x:-s/2,y:-c/2-l},{x:s/2,y:-c/2-l},...wi(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...wi(s/2+l*2,-l,l,20,-180,-270),...wi(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...wi(s/2,c/2,l,20,0,90),{x:s/2,y:c/2+l},{x:-s/2,y:c/2+l}],d=$t.svg(n),p=Rt(t,{fill:"none"});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const b=ke(u).replace("Z",""),y=d.path(b,p),x=ke(f),C=d.path(x,{...p}),A=n.insert("g",":first-child");return A.insert(()=>C,":first-child").attr("stroke-opacity",0),A.insert(()=>y,":first-child"),A.attr("class","text"),h&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(${-l}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),It(t,A),t.intersect=function(B){return vt.polygon(t,f,B)},n}m(vy,"curlyBraceRight");function lr(e,t,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,h=(a*Math.PI/180-s)/(i-1);for(let u=0;u<i;u++){const f=s+u*h,d=e+r*Math.cos(f),p=t+r*Math.sin(f);o.push({x:-d,y:-p})}return o}m(lr,"generateCirclePoints");async function _y(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:h}=t,u=[...lr(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...lr(s/2+l*2,-l,l,20,-180,-270),...lr(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...lr(s/2,c/2,l,20,0,90)],f=[...lr(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...lr(-s/2-l/2,-l,l,20,0,90),...lr(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...lr(-s/2+l+l/2,c/2,l,30,-180,-270)],d=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...lr(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...lr(s/2+l*2,-l,l,20,-180,-270),...lr(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...lr(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2-l-l/2,y:c/2+l},...lr(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...lr(-s/2-l/2,-l,l,20,0,90),...lr(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...lr(-s/2+l+l/2,c/2,l,30,-180,-270)],p=$t.svg(n),g=Rt(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const y=ke(u).replace("Z",""),x=p.path(y,g),A=ke(f).replace("Z",""),B=p.path(A,g),w=ke(d),E=p.path(w,{...g}),I=n.insert("g",":first-child");return I.insert(()=>E,":first-child").attr("stroke-opacity",0),I.insert(()=>x,":first-child"),I.insert(()=>B,":first-child"),I.attr("class","text"),h&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",h),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),I.attr("transform",`translate(${l-l/4}, 0)`),o.attr("transform",`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),It(t,I),t.intersect=function(Y){return vt.polygon(t,d,Y)},n}m(_y,"curlyBraces");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=80,s=20,c=Math.max(o,(a.width+(t.padding??0)*2)*1.25,(t==null?void 0:t.width)??0),l=Math.max(s,a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=l/2,{cssStyles:u}=t,f=$t.svg(n),d=Rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=c,g=l,b=p-h,y=g/4,x=[{x:b,y:0},{x:y,y:0},{x:0,y:g/2},{x:y,y:g},{x:b,y:g},...ls(-b,-g/2,h,50,270,90)],C=ke(x),A=f.path(C,d),B=n.insert(()=>A,":first-child");return B.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-c/2}, ${-l/2})`),It(t,B),t.intersect=function(w){return vt.polygon(t,x,w)},n}m(ky,"curvedTrapezoid");var TR=m((e,t,r,i,n,a)=>[`M${e},${t+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),ER=m((e,t,r,i,n,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),AR=m((e,t,r,i,n,a)=>[`M${e-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function wy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+t.padding,t.width??0),c=s/2,l=c/(2.5+s/50),h=Math.max(a.height+l+t.padding,t.height??0);let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=$t.svg(n),p=ER(0,0,s,h,c,l),g=AR(0,l,s,h,c,l),b=d.path(p,Rt(t,{})),y=d.path(g,Rt(t,{fill:"none"}));u=n.insert(()=>y,":first-child"),u=n.insert(()=>b,":first-child"),u.attr("class","basic label-container"),f&&u.attr("style",f)}else{const d=TR(0,0,s,h,c,l);u=n.insert("path",":first-child").attr("d",d).attr("class","basic label-container").attr("style",br(f)).attr("style",i)}return u.attr("label-offset-y",l),u.attr("transform",`translate(${-s/2}, ${-(h/2+l)})`),It(t,u),o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(d){const p=vt.rect(t,d),g=p.x-(t.x??0);if(c!=0&&(Math.abs(g)<(t.width??0)/2||Math.abs(g)==(t.width??0)/2&&Math.abs(p.y-(t.y??0))>(t.height??0)/2-l)){let b=l*l*(1-g*g/(c*c));b>0&&(b=Math.sqrt(b)),b=l-b,d.y-(t.y??0)>0&&(b=-b),p.y+=b}return p},n}m(wy,"cylinder");async function Cy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=a.width+t.padding,c=a.height+t.padding,l=c*.2,h=-s/2,u=-c/2-l/2,{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:h,y:u+l},{x:-h,y:u+l},{x:-h,y:-u},{x:h,y:-u},{x:h,y:u},{x:-h,y:u},{x:-h,y:u+l}],b=d.polygon(g.map(x=>[x.x,x.y]),p),y=n.insert(()=>b,":first-child");return y.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),o.attr("transform",`translate(${h+(t.padding??0)/2-(a.x-(a.left??0))}, ${u+l+(t.padding??0)/2-(a.y-(a.top??0))})`),It(t,y),t.intersect=function(x){return vt.rect(t,x)},n}m(Cy,"dividedRectangle");async function Sy(e,t){var f,d;const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o}=await Xt(e,t,Vt(t)),c=a.width/2+o+5,l=a.width/2+o;let h;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=$t.svg(n),g=Rt(t,{roughness:.2,strokeWidth:2.5}),b=Rt(t,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,c*2,g),x=p.circle(0,0,l*2,b);h=n.insert("g",":first-child"),h.attr("class",br(t.cssClasses)).attr("style",br(u)),(f=h.node())==null||f.appendChild(y),(d=h.node())==null||d.appendChild(x)}else{h=n.insert("g",":first-child");const p=h.insert("circle",":first-child"),g=h.insert("circle");h.attr("class","basic label-container").attr("style",i),p.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0)}return It(t,h),t.intersect=function(p){return rt.info("DoubleCircle intersect",t,c,p),vt.circle(t,c,p)},n}m(Sy,"doublecircle");function Ty(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Ot(t);t.label="",t.labelStyle=i;const a=e.insert("g").attr("class",Vt(t)).attr("id",t.domId??t.id),o=7,{cssStyles:s}=t,c=$t.svg(a),{nodeBorder:l}=r,h=Rt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const u=c.circle(0,0,o*2,h),f=a.insert(()=>u,":first-child");return f.selectAll("path").attr("style",`fill: ${l} !important;`),s&&s.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),It(t,f),t.intersect=function(d){return rt.info("filledCircle intersect",t,{radius:o,point:d}),vt.circle(t,o,d)},a}m(Ty,"filledCircle");async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=a.width+(t.padding??0),c=s+a.height,l=s+a.height,h=[{x:0,y:-c},{x:l,y:-c},{x:l/2,y:0}],{cssStyles:u}=t,f=$t.svg(n),d=Rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=ke(h),g=f.path(p,d),b=n.insert(()=>g,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=s,t.height=c,It(t,b),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-c/2+(t.padding??0)/2+(a.y-(a.top??0))})`),t.intersect=function(y){return rt.info("Triangle intersect",t,h,y),vt.polygon(t,h,y)},n}m(Ey,"flippedTriangle");function Ay(e,t,{dir:r,config:{state:i,themeVariables:n}}){const{nodeStyles:a}=Ot(t);t.label="";const o=e.insert("g").attr("class",Vt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t;let c=Math.max(70,(t==null?void 0:t.width)??0),l=Math.max(10,(t==null?void 0:t.height)??0);r==="LR"&&(c=Math.max(10,(t==null?void 0:t.width)??0),l=Math.max(70,(t==null?void 0:t.height)??0));const h=-1*c/2,u=-1*l/2,f=$t.svg(o),d=Rt(t,{stroke:n.lineColor,fill:n.lineColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=f.rectangle(h,u,c,l,d),g=o.insert(()=>p,":first-child");s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),It(t,g);const b=(i==null?void 0:i.padding)??0;return t.width&&t.height&&(t.width+=b/2||0,t.height+=b/2||0),t.intersect=function(y){return vt.rect(t,y)},o}m(Ay,"forkJoin");async function My(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const n=80,a=50,{shapeSvg:o,bbox:s}=await Xt(e,t,Vt(t)),c=Math.max(n,s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(a,s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=l/2,{cssStyles:u}=t,f=$t.svg(o),d=Rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=[{x:-c/2,y:-l/2},{x:c/2-h,y:-l/2},...ls(-c/2+h,0,h,50,90,270),{x:c/2-h,y:l/2},{x:-c/2,y:l/2}],g=ke(p),b=f.path(g,d),y=o.insert(()=>b,":first-child");return y.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),It(t,y),t.intersect=function(x){return rt.info("Pill intersect",t,{radius:h,point:x}),vt.polygon(t,p,x)},o}m(My,"halfRoundedRectangle");async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=a.height+(t.padding??0),s=a.width+(t.padding??0)*2.5,{cssStyles:c}=t,l=$t.svg(n),h=Rt(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let u=s/2;const f=u/6;u=u+f;const d=o/2,p=d/2,g=u-p,b=[{x:-g,y:-d},{x:0,y:-d},{x:g,y:-d},{x:u,y:0},{x:g,y:d},{x:0,y:d},{x:-g,y:d},{x:-u,y:0}],y=ke(b),x=l.path(y,h),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container"),c&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",c),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=s,t.height=o,It(t,C),t.intersect=function(A){return vt.polygon(t,b,A)},n}m(Ly,"hexagon");async function By(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.label="",t.labelStyle=r;const{shapeSvg:n}=await Xt(e,t,Vt(t)),a=Math.max(30,(t==null?void 0:t.width)??0),o=Math.max(30,(t==null?void 0:t.height)??0),{cssStyles:s}=t,c=$t.svg(n),l=Rt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],u=ke(h),f=c.path(u,l),d=n.insert(()=>f,":first-child");return d.attr("class","basic label-container"),s&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",s),i&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",i),d.attr("transform",`translate(${-a/2}, ${-o/2})`),It(t,d),t.intersect=function(p){return rt.info("Pill intersect",t,{points:h}),vt.polygon(t,h,p)},n}m(By,"hourglass");async function $y(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Ot(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,label:u}=await Xt(e,t,"icon-shape default"),f=t.pos==="t",d=s,p=s,{nodeBorder:g}=r,{stylesMap:b}=oa(t),y=-p/2,x=-d/2,C=t.label?8:0,A=$t.svg(l),B=Rt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const w=A.rectangle(y,x,p,d,B),E=Math.max(p,h.width),I=d+h.height+C,Y=A.rectangle(-E/2,-I/2,E,I,{...B,fill:"transparent",stroke:"none"}),q=l.insert(()=>w,":first-child"),F=l.insert(()=>Y);if(t.icon){const z=l.append("g");z.html(`<g>${await vs(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const D=z.node().getBBox(),_=D.width,T=D.height,k=D.x,S=D.y;z.attr("transform",`translate(${-_/2-k},${f?h.height/2+C/2-T/2-S:-h.height/2-C/2-T/2-S})`),z.attr("style",`color: ${b.get("stroke")??g};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-I/2:I/2-h.height})`),q.attr("transform",`translate(0,${f?h.height/2+C/2:-h.height/2-C/2})`),It(t,F),t.intersect=function(z){if(rt.info("iconSquare intersect",t,z),!t.label)return vt.rect(t,z);const D=t.x??0,_=t.y??0,T=t.height??0;let k=[];return f?k=[{x:D-h.width/2,y:_-T/2},{x:D+h.width/2,y:_-T/2},{x:D+h.width/2,y:_-T/2+h.height+C},{x:D+p/2,y:_-T/2+h.height+C},{x:D+p/2,y:_+T/2},{x:D-p/2,y:_+T/2},{x:D-p/2,y:_-T/2+h.height+C},{x:D-h.width/2,y:_-T/2+h.height+C}]:k=[{x:D-p/2,y:_-T/2},{x:D+p/2,y:_-T/2},{x:D+p/2,y:_-T/2+d},{x:D+h.width/2,y:_-T/2+d},{x:D+h.width/2/2,y:_+T/2},{x:D-h.width/2,y:_+T/2},{x:D-h.width/2,y:_-T/2+d},{x:D-p/2,y:_-T/2+d}],vt.polygon(t,k,z)},l}m($y,"icon");async function Ry(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Ot(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,label:u}=await Xt(e,t,"icon-shape default"),f=20,d=t.label?8:0,p=t.pos==="t",{nodeBorder:g,mainBkg:b}=r,{stylesMap:y}=oa(t),x=$t.svg(l),C=Rt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const A=y.get("fill");C.stroke=A??b;const B=l.append("g");t.icon&&B.html(`<g>${await vs(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const w=B.node().getBBox(),E=w.width,I=w.height,Y=w.x,q=w.y,F=Math.max(E,I)*Math.SQRT2+f*2,z=x.circle(0,0,F,C),D=Math.max(F,h.width),_=F+h.height+d,T=x.rectangle(-D/2,-_/2,D,_,{...C,fill:"transparent",stroke:"none"}),k=l.insert(()=>z,":first-child"),S=l.insert(()=>T);return B.attr("transform",`translate(${-E/2-Y},${p?h.height/2+d/2-I/2-q:-h.height/2-d/2-I/2-q})`),B.attr("style",`color: ${y.get("stroke")??g};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),k.attr("transform",`translate(0,${p?h.height/2+d/2:-h.height/2-d/2})`),It(t,S),t.intersect=function(M){return rt.info("iconSquare intersect",t,M),vt.rect(t,M)},l}m(Ry,"iconCircle");async function Oy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Ot(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,halfPadding:u,label:f}=await Xt(e,t,"icon-shape default"),d=t.pos==="t",p=s+u*2,g=s+u*2,{nodeBorder:b,mainBkg:y}=r,{stylesMap:x}=oa(t),C=-g/2,A=-p/2,B=t.label?8:0,w=$t.svg(l),E=Rt(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const I=x.get("fill");E.stroke=I??y;const Y=w.path(Gi(C,A,g,p,5),E),q=Math.max(g,h.width),F=p+h.height+B,z=w.rectangle(-q/2,-F/2,q,F,{...E,fill:"transparent",stroke:"none"}),D=l.insert(()=>Y,":first-child").attr("class","icon-shape2"),_=l.insert(()=>z);if(t.icon){const T=l.append("g");T.html(`<g>${await vs(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const k=T.node().getBBox(),S=k.width,M=k.height,W=k.x,N=k.y;T.attr("transform",`translate(${-S/2-W},${d?h.height/2+B/2-M/2-N:-h.height/2-B/2-M/2-N})`),T.attr("style",`color: ${x.get("stroke")??b};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-F/2:F/2-h.height})`),D.attr("transform",`translate(0,${d?h.height/2+B/2:-h.height/2-B/2})`),It(t,_),t.intersect=function(T){if(rt.info("iconSquare intersect",t,T),!t.label)return vt.rect(t,T);const k=t.x??0,S=t.y??0,M=t.height??0;let W=[];return d?W=[{x:k-h.width/2,y:S-M/2},{x:k+h.width/2,y:S-M/2},{x:k+h.width/2,y:S-M/2+h.height+B},{x:k+g/2,y:S-M/2+h.height+B},{x:k+g/2,y:S+M/2},{x:k-g/2,y:S+M/2},{x:k-g/2,y:S-M/2+h.height+B},{x:k-h.width/2,y:S-M/2+h.height+B}]:W=[{x:k-g/2,y:S-M/2},{x:k+g/2,y:S-M/2},{x:k+g/2,y:S-M/2+p},{x:k+h.width/2,y:S-M/2+p},{x:k+h.width/2/2,y:S+M/2},{x:k-h.width/2,y:S+M/2},{x:k-h.width/2,y:S-M/2+p},{x:k-g/2,y:S-M/2+p}],vt.polygon(t,W,T)},l}m(Oy,"iconRounded");async function Ny(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Ot(t);t.labelStyle=n;const a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=i==null?void 0:i.wrappingWidth;t.width=Math.max(s,c??0);const{shapeSvg:l,bbox:h,halfPadding:u,label:f}=await Xt(e,t,"icon-shape default"),d=t.pos==="t",p=s+u*2,g=s+u*2,{nodeBorder:b,mainBkg:y}=r,{stylesMap:x}=oa(t),C=-g/2,A=-p/2,B=t.label?8:0,w=$t.svg(l),E=Rt(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const I=x.get("fill");E.stroke=I??y;const Y=w.path(Gi(C,A,g,p,.1),E),q=Math.max(g,h.width),F=p+h.height+B,z=w.rectangle(-q/2,-F/2,q,F,{...E,fill:"transparent",stroke:"none"}),D=l.insert(()=>Y,":first-child"),_=l.insert(()=>z);if(t.icon){const T=l.append("g");T.html(`<g>${await vs(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const k=T.node().getBBox(),S=k.width,M=k.height,W=k.x,N=k.y;T.attr("transform",`translate(${-S/2-W},${d?h.height/2+B/2-M/2-N:-h.height/2-B/2-M/2-N})`),T.attr("style",`color: ${x.get("stroke")??b};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${d?-F/2:F/2-h.height})`),D.attr("transform",`translate(0,${d?h.height/2+B/2:-h.height/2-B/2})`),It(t,_),t.intersect=function(T){if(rt.info("iconSquare intersect",t,T),!t.label)return vt.rect(t,T);const k=t.x??0,S=t.y??0,M=t.height??0;let W=[];return d?W=[{x:k-h.width/2,y:S-M/2},{x:k+h.width/2,y:S-M/2},{x:k+h.width/2,y:S-M/2+h.height+B},{x:k+g/2,y:S-M/2+h.height+B},{x:k+g/2,y:S+M/2},{x:k-g/2,y:S+M/2},{x:k-g/2,y:S-M/2+h.height+B},{x:k-h.width/2,y:S-M/2+h.height+B}]:W=[{x:k-g/2,y:S-M/2},{x:k+g/2,y:S-M/2},{x:k+g/2,y:S-M/2+p},{x:k+h.width/2,y:S-M/2+p},{x:k+h.width/2/2,y:S+M/2},{x:k-h.width/2,y:S+M/2},{x:k-h.width/2,y:S-M/2+p},{x:k-g/2,y:S-M/2+p}],vt.polygon(t,W,T)},l}m(Ny,"iconSquare");async function Iy(e,t,{config:{flowchart:r}}){const i=new Image;i.src=(t==null?void 0:t.img)??"",await i.decode();const n=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=n/a;const{labelStyles:o}=Ot(t);t.labelStyle=o;const s=r==null?void 0:r.wrappingWidth;t.defaultWidth=r==null?void 0:r.wrappingWidth;const c=Math.max(t.label?s??0:0,(t==null?void 0:t.assetWidth)??n),l=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:c,h=t.constraint==="on"?l/t.imageAspectRatio:(t==null?void 0:t.assetHeight)??a;t.width=Math.max(l,s??0);const{shapeSvg:u,bbox:f,label:d}=await Xt(e,t,"image-shape default"),p=t.pos==="t",g=-l/2,b=-h/2,y=t.label?8:0,x=$t.svg(u),C=Rt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const A=x.rectangle(g,b,l,h,C),B=Math.max(l,f.width),w=h+f.height+y,E=x.rectangle(-B/2,-w/2,B,w,{...C,fill:"none",stroke:"none"}),I=u.insert(()=>A,":first-child"),Y=u.insert(()=>E);if(t.img){const q=u.append("image");q.attr("href",t.img),q.attr("width",l),q.attr("height",h),q.attr("preserveAspectRatio","none"),q.attr("transform",`translate(${-l/2},${p?w/2-h:-w/2})`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-h/2-f.height/2-y/2:h/2-f.height/2+y/2})`),I.attr("transform",`translate(0,${p?f.height/2+y/2:-f.height/2-y/2})`),It(t,Y),t.intersect=function(q){if(rt.info("iconSquare intersect",t,q),!t.label)return vt.rect(t,q);const F=t.x??0,z=t.y??0,D=t.height??0;let _=[];return p?_=[{x:F-f.width/2,y:z-D/2},{x:F+f.width/2,y:z-D/2},{x:F+f.width/2,y:z-D/2+f.height+y},{x:F+l/2,y:z-D/2+f.height+y},{x:F+l/2,y:z+D/2},{x:F-l/2,y:z+D/2},{x:F-l/2,y:z-D/2+f.height+y},{x:F-f.width/2,y:z-D/2+f.height+y}]:_=[{x:F-l/2,y:z-D/2},{x:F+l/2,y:z-D/2},{x:F+l/2,y:z-D/2+h},{x:F+f.width/2,y:z-D/2+h},{x:F+f.width/2/2,y:z+D/2},{x:F-f.width/2,y:z+D/2},{x:F-f.width/2,y:z-D/2+h},{x:F-l/2,y:z-D/2+h}],vt.polygon(t,_,q)},u}m(Iy,"imageSquare");async function Dy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=$t.svg(n),f=Rt(t,{}),d=ke(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=Yi(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,It(t,l),t.intersect=function(u){return vt.polygon(t,c,u)},n}m(Dy,"inv_trapezoid");async function Sl(e,t,r){const{labelStyles:i,nodeStyles:n}=Ot(t);t.labelStyle=i;const{shapeSvg:a,bbox:o}=await Xt(e,t,Vt(t)),s=Math.max(o.width+r.labelPaddingX*2,(t==null?void 0:t.width)||0),c=Math.max(o.height+r.labelPaddingY*2,(t==null?void 0:t.height)||0),l=-s/2,h=-c/2;let u,{rx:f,ry:d}=t;const{cssStyles:p}=t;if(r!=null&&r.rx&&r.ry&&(f=r.rx,d=r.ry),t.look==="handDrawn"){const g=$t.svg(a),b=Rt(t,{}),y=f||d?g.path(Gi(l,h,s,c,f||0),b):g.rectangle(l,h,s,c,b);u=a.insert(()=>y,":first-child"),u.attr("class","basic label-container").attr("style",br(p))}else u=a.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",n).attr("rx",br(f)).attr("ry",br(d)).attr("x",l).attr("y",h).attr("width",s).attr("height",c);return It(t,u),t.calcIntersect=function(g,b){return vt.rect(g,b)},t.intersect=function(g){return vt.rect(t,g)},a}m(Sl,"drawRect");async function Fy(e,t){const{shapeSvg:r,bbox:i,label:n}=await Xt(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),n.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),It(t,a),t.intersect=function(c){return vt.rect(t,c)},r}m(Fy,"labelRect");async function Py(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),c=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-(3*s)/6,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=$t.svg(n),f=Rt(t,{}),d=ke(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=Yi(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,It(t,l),t.intersect=function(u){return vt.polygon(t,c,u)},n}m(Py,"lean_left");async function zy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),c=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=$t.svg(n),f=Rt(t,{}),d=ke(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=Yi(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,It(t,l),t.intersect=function(u){return vt.polygon(t,c,u)},n}m(zy,"lean_right");function Wy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.label="",t.labelStyle=r;const n=e.insert("g").attr("class",Vt(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,(t==null?void 0:t.width)??0),s=Math.max(35,(t==null?void 0:t.height)??0),c=7,l=[{x:o,y:0},{x:0,y:s+c/2},{x:o-2*c,y:s+c/2},{x:0,y:2*s},{x:o,y:s-c/2},{x:2*c,y:s-c/2}],h=$t.svg(n),u=Rt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=ke(l),d=h.path(f,u),p=n.insert(()=>d,":first-child");return a&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${o/2},${-s})`),It(t,p),t.intersect=function(g){return rt.info("lightningBolt intersect",t,g),vt.polygon(t,l,g)},n}m(Wy,"lightningBolt");var MR=m((e,t,r,i,n,a,o)=>[`M${e},${t+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+o}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),LR=m((e,t,r,i,n,a,o)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+o}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),BR=m((e,t,r,i,n,a)=>[`M${e-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function qy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0),t.width??0),c=s/2,l=c/(2.5+s/50),h=Math.max(a.height+l+(t.padding??0),t.height??0),u=h*.1;let f;const{cssStyles:d}=t;if(t.look==="handDrawn"){const p=$t.svg(n),g=LR(0,0,s,h,c,l,u),b=BR(0,l,s,h,c,l),y=Rt(t,{}),x=p.path(g,y),C=p.path(b,y);n.insert(()=>C,":first-child").attr("class","line"),f=n.insert(()=>x,":first-child"),f.attr("class","basic label-container"),d&&f.attr("style",d)}else{const p=MR(0,0,s,h,c,l,u);f=n.insert("path",":first-child").attr("d",p).attr("class","basic label-container").attr("style",br(d)).attr("style",i)}return f.attr("label-offset-y",l),f.attr("transform",`translate(${-s/2}, ${-(h/2+l)})`),It(t,f),o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+l-(a.y-(a.top??0))})`),t.intersect=function(p){const g=vt.rect(t,p),b=g.x-(t.x??0);if(c!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(g.y-(t.y??0))>(t.height??0)/2-l)){let y=l*l*(1-b*b/(c*c));y>0&&(y=Math.sqrt(y)),y=l-y,p.y-(t.y??0)>0&&(y=-y),g.y+=y}return g},n}m(qy,"linedCylinder");async function Hy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/4,h=c+l,{cssStyles:u}=t,f=$t.svg(n),d=Rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=[{x:-s/2-s/2*.1,y:-h/2},{x:-s/2-s/2*.1,y:h/2},...Hi(-s/2-s/2*.1,h/2,s/2+s/2*.1,h/2,l,.8),{x:s/2+s/2*.1,y:-h/2},{x:-s/2-s/2*.1,y:-h/2},{x:-s/2,y:-h/2},{x:-s/2,y:h/2*1.1},{x:-s/2,y:-h/2}],g=f.polygon(p.map(y=>[y.x,y.y]),d),b=n.insert(()=>g,":first-child");return b.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),It(t,b),t.intersect=function(y){return vt.polygon(t,p,y)},n}m(Hy,"linedWaveEdgedRect");async function jy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=5,h=-s/2,u=-c/2,{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{}),g=[{x:h-l,y:u+l},{x:h-l,y:u+c+l},{x:h+s-l,y:u+c+l},{x:h+s-l,y:u+c},{x:h+s,y:u+c},{x:h+s,y:u+c-l},{x:h+s+l,y:u+c-l},{x:h+s+l,y:u-l},{x:h+l,y:u-l},{x:h+l,y:u},{x:h,y:u},{x:h,y:u+l}],b=[{x:h,y:u+l},{x:h+s-l,y:u+l},{x:h+s-l,y:u+c},{x:h+s,y:u+c},{x:h+s,y:u},{x:h,y:u}];t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const y=ke(g),x=d.path(y,p),C=ke(b),A=d.path(C,{...p,fill:"none"}),B=n.insert(()=>A,":first-child");return B.insert(()=>x,":first-child"),B.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(a.width/2)-l-(a.x-(a.left??0))}, ${-(a.height/2)+l-(a.y-(a.top??0))})`),It(t,B),t.intersect=function(w){return vt.polygon(t,g,w)},n}m(jy,"multiRect");async function Uy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/4,h=c+l,u=-s/2,f=-h/2,d=5,{cssStyles:p}=t,g=Hi(u-d,f+h+d,u+s-d,f+h+d,l,.8),b=g==null?void 0:g[g.length-1],y=[{x:u-d,y:f+d},{x:u-d,y:f+h+d},...g,{x:u+s-d,y:b.y-d},{x:u+s,y:b.y-d},{x:u+s,y:b.y-2*d},{x:u+s+d,y:b.y-2*d},{x:u+s+d,y:f-d},{x:u+d,y:f-d},{x:u+d,y:f},{x:u,y:f},{x:u,y:f+d}],x=[{x:u,y:f+d},{x:u+s-d,y:f+d},{x:u+s-d,y:b.y-d},{x:u+s,y:b.y-d},{x:u+s,y:f},{x:u,y:f}],C=$t.svg(n),A=Rt(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const B=ke(y),w=C.path(B,A),E=ke(x),I=C.path(E,A),Y=n.insert(()=>w,":first-child");return Y.insert(()=>I),Y.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&Y.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&Y.selectAll("path").attr("style",i),Y.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)+d-l/2-(a.y-(a.top??0))})`),It(t,Y),t.intersect=function(q){return vt.polygon(t,y,q)},n}m(Uy,"multiWaveEdgedRectangle");async function Gy(e,t,{config:{themeVariables:r}}){var x;const{labelStyles:i,nodeStyles:n}=Ot(t);t.labelStyle=i,t.useHtmlLabels||((x=gr().flowchart)==null?void 0:x.htmlLabels)!==!1||(t.centerLabel=!0);const{shapeSvg:o,bbox:s,label:c}=await Xt(e,t,Vt(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=-l/2,f=-h/2,{cssStyles:d}=t,p=$t.svg(o),g=Rt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=p.rectangle(u,f,l,h,g),y=o.insert(()=>b,":first-child");return y.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),c.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),It(t,y),t.intersect=function(C){return vt.rect(t,C)},o}m(Gy,"note");var $R=m((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Yy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=a.width+t.padding,s=a.height+t.padding,c=o+s,l=.5,h=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const d=$t.svg(n),p=Rt(t,{}),g=$R(0,0,c),b=d.path(g,p);u=n.insert(()=>b,":first-child").attr("transform",`translate(${-c/2+l}, ${c/2})`),f&&u.attr("style",f)}else u=Yi(n,c,c,h),u.attr("transform",`translate(${-c/2+l}, ${c/2})`);return i&&u.attr("style",i),It(t,u),t.calcIntersect=function(d,p){const g=d.width,b=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}],y=vt.polygon(d,b,p);return{x:y.x-.5,y:y.y-.5}},t.intersect=function(d){return this.calcIntersect(t,d)},n}m(Yy,"question");async function Vy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),l=-s/2,h=-c/2,u=h/2,f=[{x:l+u,y:h},{x:l,y:0},{x:l+u,y:-h},{x:-l,y:-h},{x:-l,y:h}],{cssStyles:d}=t,p=$t.svg(n),g=Rt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=ke(f),y=p.path(b,g),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),x.attr("transform",`translate(${-u/2},0)`),o.attr("transform",`translate(${-u/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),It(t,x),t.intersect=function(C){return vt.polygon(t,f,C)},n}m(Vy,"rect_left_inv_arrow");async function Xy(e,t){var I,Y;const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;let n;t.cssClasses?n="node "+t.cssClasses:n="node default";const a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",i),c=t.description,l=t.label,h=s.node().appendChild(await hn(l,t.labelStyle,!0,!0));let u={width:0,height:0};if(nr((Y=(I=Re())==null?void 0:I.flowchart)==null?void 0:Y.htmlLabels)){const q=h.children[0],F=se(h);u=q.getBoundingClientRect(),F.attr("width",u.width),F.attr("height",u.height)}rt.info("Text 2",c);const f=c||[],d=h.getBBox(),p=s.node().appendChild(await hn(f.join?f.join("<br/>"):f,t.labelStyle,!0,!0)),g=p.children[0],b=se(p);u=g.getBoundingClientRect(),b.attr("width",u.width),b.attr("height",u.height);const y=(t.padding||0)/2;se(p).attr("transform","translate( "+(u.width>d.width?0:(d.width-u.width)/2)+", "+(d.height+y+5)+")"),se(h).attr("transform","translate( "+(u.width<d.width?0:-(d.width-u.width)/2)+", 0)"),u=s.node().getBBox(),s.attr("transform","translate("+-u.width/2+", "+(-u.height/2-y+3)+")");const x=u.width+(t.padding||0),C=u.height+(t.padding||0),A=-u.width/2-y,B=-u.height/2-y;let w,E;if(t.look==="handDrawn"){const q=$t.svg(a),F=Rt(t,{}),z=q.path(Gi(A,B,x,C,t.rx||0),F),D=q.line(-u.width/2-y,-u.height/2-y+d.height+y,u.width/2+y,-u.height/2-y+d.height+y,F);E=a.insert(()=>(rt.debug("Rough node insert CXC",z),D),":first-child"),w=a.insert(()=>(rt.debug("Rough node insert CXC",z),z),":first-child")}else w=o.insert("rect",":first-child"),E=o.insert("line"),w.attr("class","outer title-state").attr("style",i).attr("x",-u.width/2-y).attr("y",-u.height/2-y).attr("width",u.width+(t.padding||0)).attr("height",u.height+(t.padding||0)),E.attr("class","divider").attr("x1",-u.width/2-y).attr("x2",u.width/2+y).attr("y1",-u.height/2-y+d.height+y).attr("y2",-u.height/2-y+d.height+y);return It(t,w),t.intersect=function(q){return vt.rect(t,q)},a}m(Xy,"rectWithTitle");function Da(e,t,r,i,n,a,o){const c=(e+r)/2,l=(t+i)/2,h=Math.atan2(i-t,r-e),u=(r-e)/2,f=(i-t)/2,d=u/n,p=f/a,g=Math.sqrt(d**2+p**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");const b=Math.sqrt(1-g**2),y=c+b*a*Math.sin(h)*(o?-1:1),x=l-b*n*Math.cos(h)*(o?-1:1),C=Math.atan2((t-x)/a,(e-y)/n);let B=Math.atan2((i-x)/a,(r-y)/n)-C;o&&B<0&&(B+=2*Math.PI),!o&&B>0&&(B-=2*Math.PI);const w=[];for(let E=0;E<20;E++){const I=E/19,Y=C+I*B,q=y+n*Math.cos(Y),F=x+a*Math.sin(Y);w.push({x:q,y:F})}return w}m(Da,"generateArcPoints");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=(t==null?void 0:t.padding)??0,s=(t==null?void 0:t.padding)??0,c=(t!=null&&t.width?t==null?void 0:t.width:a.width)+o*2,l=(t!=null&&t.height?t==null?void 0:t.height:a.height)+s*2,h=t.radius||5,u=t.taper||5,{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{});t.stroke&&(p.stroke=t.stroke),t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-c/2+u,y:-l/2},{x:c/2-u,y:-l/2},...Da(c/2-u,-l/2,c/2,-l/2+u,h,h,!0),{x:c/2,y:-l/2+u},{x:c/2,y:l/2-u},...Da(c/2,l/2-u,c/2-u,l/2,h,h,!0),{x:c/2-u,y:l/2},{x:-c/2+u,y:l/2},...Da(-c/2+u,l/2,-c/2,l/2-u,h,h,!0),{x:-c/2,y:l/2-u},{x:-c/2,y:-l/2+u},...Da(-c/2,-l/2+u,-c/2+u,-l/2,h,h,!0)],b=ke(g),y=d.path(b,p),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),It(t,x),t.intersect=function(C){return vt.polygon(t,g,C)},n}m(Zy,"roundedRect");async function Ky(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=(t==null?void 0:t.padding)??0,c=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=-a.width/2-s,u=-a.height/2-s,{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:h,y:u},{x:h+c+8,y:u},{x:h+c+8,y:u+l},{x:h-8,y:u+l},{x:h-8,y:u},{x:h,y:u},{x:h,y:u+l}],b=d.polygon(g.map(x=>[x.x,x.y]),p),y=n.insert(()=>b,":first-child");return y.attr("class","basic label-container").attr("style",br(f)),i&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",i),o.attr("transform",`translate(${-c/2+4+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-(a.y-(a.top??0))})`),It(t,y),t.intersect=function(x){return vt.rect(t,x)},n}m(Ky,"shadedProcess");async function Qy(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=-s/2,h=-c/2,{cssStyles:u}=t,f=$t.svg(n),d=Rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const p=[{x:l,y:h},{x:l,y:h+c},{x:l+s,y:h+c},{x:l+s,y:h-c/2}],g=ke(p),b=f.path(g,d),y=n.insert(()=>b,":first-child");return y.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),y.attr("transform",`translate(0, ${c/4})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))}, ${-c/4+(t.padding??0)-(a.y-(a.top??0))})`),It(t,y),t.intersect=function(x){return vt.polygon(t,p,x)},n}m(Qy,"slopedRect");async function Jy(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Sl(e,t,r)}m(Jy,"squareRect");async function tx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=a.height+t.padding,s=a.width+o/4+t.padding,c=o/2,{cssStyles:l}=t,h=$t.svg(n),u=Rt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=[{x:-s/2+c,y:-o/2},{x:s/2-c,y:-o/2},...ls(-s/2+c,0,c,50,90,270),{x:s/2-c,y:o/2},...ls(s/2-c,0,c,50,270,450)],d=ke(f),p=h.path(d,u),g=n.insert(()=>p,":first-child");return g.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&g.selectChildren("path").attr("style",l),i&&t.look!=="handDrawn"&&g.selectChildren("path").attr("style",i),It(t,g),t.intersect=function(b){return vt.polygon(t,f,b)},n}m(tx,"stadium");async function ex(e,t){return Sl(e,t,{rx:5,ry:5})}m(ex,"state");function rx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Ot(t);t.labelStyle=i;const{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c}=r,l=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),h=$t.svg(l),u=Rt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=h.circle(0,0,14,{...u,stroke:o,strokeWidth:2}),d=s??c,p=h.circle(0,0,5,{...u,fill:d,stroke:d,strokeWidth:2,fillStyle:"solid"}),g=l.insert(()=>f,":first-child");return g.insert(()=>p),a&&g.selectAll("path").attr("style",a),n&&g.selectAll("path").attr("style",n),It(t,g),t.intersect=function(b){return vt.circle(t,7,b)},l}m(rx,"stateEnd");function ix(e,t,{config:{themeVariables:r}}){const{lineColor:i}=r,n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const s=$t.svg(n).circle(0,0,14,YM(i));a=n.insert(()=>s),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=n.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return It(t,a),t.intersect=function(o){return vt.circle(t,7,o)},n}m(ix,"stateStart");async function nx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=((t==null?void 0:t.padding)||0)/2,s=a.width+t.padding,c=a.height+t.padding,l=-a.width/2-o,h=-a.height/2-o,u=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look==="handDrawn"){const f=$t.svg(n),d=Rt(t,{}),p=f.rectangle(l-8,h,s+16,c,d),g=f.line(l,h,l,h+c,d),b=f.line(l+s,h,l+s,h+c,d);n.insert(()=>g,":first-child"),n.insert(()=>b,":first-child");const y=n.insert(()=>p,":first-child"),{cssStyles:x}=t;y.attr("class","basic label-container").attr("style",br(x)),It(t,y)}else{const f=Yi(n,s,c,u);i&&f.attr("style",i),It(t,f)}return t.intersect=function(f){return vt.polygon(t,u,f)},n}m(nx,"subroutine");async function ax(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),s=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),c=-o/2,l=-s/2,h=.2*s,u=.2*s,{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{}),g=[{x:c-h/2,y:l},{x:c+o+h/2,y:l},{x:c+o+h/2,y:l+s},{x:c-h/2,y:l+s}],b=[{x:c+o-h/2,y:l+s},{x:c+o+h/2,y:l+s},{x:c+o+h/2,y:l+s-u}];t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const y=ke(g),x=d.path(y,p),C=ke(b),A=d.path(C,{...p,fillStyle:"solid"}),B=n.insert(()=>A,":first-child");return B.insert(()=>x,":first-child"),B.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),It(t,B),t.intersect=function(w){return vt.polygon(t,g,w)},n}m(ax,"taggedRect");async function sx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/4,h=.2*s,u=.2*c,f=c+l,{cssStyles:d}=t,p=$t.svg(n),g=Rt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const b=[{x:-s/2-s/2*.1,y:f/2},...Hi(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,x=-f/2-u*.4,C=[{x:y+s-h,y:(x+c)*1.4},{x:y+s,y:x+c-u},{x:y+s,y:(x+c)*.9},...Hi(y+s,(x+c)*1.3,y+s-h,(x+c)*1.5,-c*.03,.5)],A=ke(b),B=p.path(A,g),w=ke(C),E=p.path(w,{...g,fillStyle:"solid"}),I=n.insert(()=>E,":first-child");return I.insert(()=>B,":first-child"),I.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),I.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),It(t,I),t.intersect=function(Y){return vt.polygon(t,b,Y)},n}m(sx,"taggedWaveEdgedRectangle");async function ox(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=Math.max(a.width+t.padding,(t==null?void 0:t.width)||0),s=Math.max(a.height+t.padding,(t==null?void 0:t.height)||0),c=-o/2,l=-s/2,h=n.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",c).attr("y",l).attr("width",o).attr("height",s),It(t,h),t.intersect=function(u){return vt.rect(t,u)},n}m(ox,"text");var RR=m((e,t,r,i,n,a)=>`M${e},${t}
|
|
264
|
+
a${n},${a} 0,0,1 0,${-i}
|
|
265
|
+
l${r},0
|
|
266
|
+
a${n},${a} 0,0,1 0,${i}
|
|
267
|
+
M${r},${-i}
|
|
268
|
+
a${n},${a} 0,0,0 0,${i}
|
|
269
|
+
l${-r},0`,"createCylinderPathD"),OR=m((e,t,r,i,n,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${n},${a} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${a} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),NR=m((e,t,r,i,n,a)=>[`M${e+r/2},${-i/2}`,`a${n},${a} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function lx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o,halfPadding:s}=await Xt(e,t,Vt(t)),c=t.look==="neo"?s*2:s,l=a.height+c,h=l/2,u=h/(2.5+l/50),f=a.width+u+c,{cssStyles:d}=t;let p;if(t.look==="handDrawn"){const g=$t.svg(n),b=OR(0,0,f,l,u,h),y=NR(0,0,f,l,u,h),x=g.path(b,Rt(t,{})),C=g.path(y,Rt(t,{fill:"none"}));p=n.insert(()=>C,":first-child"),p=n.insert(()=>x,":first-child"),p.attr("class","basic label-container"),d&&p.attr("style",d)}else{const g=RR(0,0,f,l,u,h);p=n.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",br(d)).attr("style",i),p.attr("class","basic label-container"),d&&p.selectAll("path").attr("style",d),i&&p.selectAll("path").attr("style",i)}return p.attr("label-offset-x",u),p.attr("transform",`translate(${-f/2}, ${l/2} )`),o.attr("transform",`translate(${-(a.width/2)-u-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),It(t,p),t.intersect=function(g){const b=vt.rect(t,g),y=b.y-(t.y??0);if(h!=0&&(Math.abs(y)<(t.height??0)/2||Math.abs(y)==(t.height??0)/2&&Math.abs(b.x-(t.x??0))>(t.width??0)/2-u)){let x=u*u*(1-y*y/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=u-x,g.x-(t.x??0)>0&&(x=-x),b.x+=x}return b},n}m(lx,"tiltedCylinder");async function cx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=a.width+t.padding,s=a.height+t.padding,c=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}];let l;const{cssStyles:h}=t;if(t.look==="handDrawn"){const u=$t.svg(n),f=Rt(t,{}),d=ke(c),p=u.path(d,f);l=n.insert(()=>p,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),h&&l.attr("style",h)}else l=Yi(n,o,s,c);return i&&l.attr("style",i),t.width=o,t.height=s,It(t,l),t.intersect=function(u){return vt.polygon(t,c,u)},n}m(cx,"trapezoid");async function hx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=60,s=20,c=Math.max(o,a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s,a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),{cssStyles:h}=t,u=$t.svg(n),f=Rt(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const d=[{x:-c/2*.8,y:-l/2},{x:c/2*.8,y:-l/2},{x:c/2,y:-l/2*.6},{x:c/2,y:l/2},{x:-c/2,y:l/2},{x:-c/2,y:-l/2*.6}],p=ke(d),g=u.path(p,f),b=n.insert(()=>g,":first-child");return b.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",h),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),It(t,b),t.intersect=function(y){return vt.polygon(t,d,y)},n}m(hx,"trapezoidalPentagon");async function ux(e,t){var x;const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=nr((x=Re().flowchart)==null?void 0:x.htmlLabels),c=a.width+(t.padding??0),l=c+a.height,h=c+a.height,u=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-l}],{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=ke(u),b=d.path(g,p),y=n.insert(()=>b,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return f&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),t.width=c,t.height=l,It(t,y),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${l/2-(a.height+(t.padding??0)/(s?2:1)-(a.y-(a.top??0)))})`),t.intersect=function(C){return rt.info("Triangle intersect",t,u,C),vt.polygon(t,u,C)},n}m(ux,"triangle");async function dx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=c/8,h=c+l,{cssStyles:u}=t,d=70-s,p=d>0?d/2:0,g=$t.svg(n),b=Rt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const y=[{x:-s/2-p,y:h/2},...Hi(-s/2-p,h/2,s/2+p,h/2,l,.8),{x:s/2+p,y:-h/2},{x:-s/2-p,y:-h/2}],x=ke(y),C=g.path(x,b),A=n.insert(()=>C,":first-child");return A.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(0,${-l/2})`),o.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l-(a.y-(a.top??0))})`),It(t,A),t.intersect=function(B){return vt.polygon(t,y,B)},n}m(dx,"waveEdgedRectangle");async function fx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a}=await Xt(e,t,Vt(t)),o=100,s=50,c=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=c/l;let u=c,f=l;u>f*h?f=u/h:u=f*h,u=Math.max(u,o),f=Math.max(f,s);const d=Math.min(f*.2,f/4),p=f+d*2,{cssStyles:g}=t,b=$t.svg(n),y=Rt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-u/2,y:p/2},...Hi(-u/2,p/2,u/2,p/2,d,1),{x:u/2,y:-p/2},...Hi(u/2,-p/2,-u/2,-p/2,d,-1)],C=ke(x),A=b.path(C,y),B=n.insert(()=>A,":first-child");return B.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),It(t,B),t.intersect=function(w){return vt.polygon(t,x,w)},n}m(fx,"waveRectangle");async function px(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Xt(e,t,Vt(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),c=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),l=5,h=-s/2,u=-c/2,{cssStyles:f}=t,d=$t.svg(n),p=Rt(t,{}),g=[{x:h-l,y:u-l},{x:h-l,y:u+c},{x:h+s,y:u+c},{x:h+s,y:u-l}],b=`M${h-l},${u-l} L${h+s},${u-l} L${h+s},${u+c} L${h-l},${u+c} L${h-l},${u-l}
|
|
270
|
+
M${h-l},${u} L${h+s},${u}
|
|
271
|
+
M${h},${u-l} L${h},${u+c}`;t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const y=d.path(b,p),x=n.insert(()=>y,":first-child");return x.attr("transform",`translate(${l/2}, ${l/2})`),x.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(a.width/2)+l/2-(a.x-(a.left??0))}, ${-(a.height/2)+l/2-(a.y-(a.top??0))})`),It(t,x),t.intersect=function(C){return vt.polygon(t,g,C)},n}m(px,"windowPane");async function $u(e,t){var j,G,X,J;const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:K}=gr(),{background:at}=K,lt={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${at}`]};await $u(e,lt)}const i=gr();t.useHtmlLabels=i.htmlLabels;let n=((j=i.er)==null?void 0:j.diagramPadding)??10,a=((G=i.er)==null?void 0:G.entityPadding)??6;const{cssStyles:o}=t,{labelStyles:s,nodeStyles:c}=Ot(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:n,labelPaddingY:n*1.5};Li(t.label,i)+K.labelPaddingX*2<i.er.minEntityWidth&&(t.width=i.er.minEntityWidth);const at=await Sl(e,t,K);if(!nr(i.htmlLabels)){const lt=at.select("text"),wt=(X=lt.node())==null?void 0:X.getBBox();lt.attr("transform",`translate(${-wt.width/2}, 0)`)}return at}i.htmlLabels||(n*=1.25,a*=1.25);let l=Vt(t);l||(l="node default");const h=e.insert("g").attr("class",l).attr("id",t.domId||t.id),u=await Bn(h,t.label??"",i,0,0,["name"],s);u.height+=a;let f=0;const d=[],p=[];let g=0,b=0,y=0,x=0,C=!0,A=!0;for(const K of r.attributes){const at=await Bn(h,K.type,i,0,f,["attribute-type"],s);g=Math.max(g,at.width+n);const lt=await Bn(h,K.name,i,0,f,["attribute-name"],s);b=Math.max(b,lt.width+n);const wt=await Bn(h,K.keys.join(),i,0,f,["attribute-keys"],s);y=Math.max(y,wt.width+n);const _t=await Bn(h,K.comment,i,0,f,["attribute-comment"],s);x=Math.max(x,_t.width+n);const ot=Math.max(at.height,lt.height,wt.height,_t.height)+a;p.push({yOffset:f,rowHeight:ot}),f+=ot}let B=4;y<=n&&(C=!1,y=0,B--),x<=n&&(A=!1,x=0,B--);const w=h.node().getBBox();if(u.width+n*2-(g+b+y+x)>0){const K=u.width+n*2-(g+b+y+x);g+=K/B,b+=K/B,y>0&&(y+=K/B),x>0&&(x+=K/B)}const E=g+b+y+x,I=$t.svg(h),Y=Rt(t,{});t.look!=="handDrawn"&&(Y.roughness=0,Y.fillStyle="solid");let q=0;p.length>0&&(q=p.reduce((K,at)=>K+((at==null?void 0:at.rowHeight)??0),0));const F=Math.max(w.width+n*2,(t==null?void 0:t.width)||0,E),z=Math.max((q??0)+u.height,(t==null?void 0:t.height)||0),D=-F/2,_=-z/2;h.selectAll("g:not(:first-child)").each((K,at,lt)=>{const wt=se(lt[at]),_t=wt.attr("transform");let ot=0,Ct=0;if(_t){const Ht=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(_t);Ht&&(ot=parseFloat(Ht[1]),Ct=parseFloat(Ht[2]),wt.attr("class").includes("attribute-name")?ot+=g:wt.attr("class").includes("attribute-keys")?ot+=g+b:wt.attr("class").includes("attribute-comment")&&(ot+=g+b+y))}wt.attr("transform",`translate(${D+n/2+ot}, ${Ct+_+u.height+a/2})`)}),h.select(".name").attr("transform","translate("+-u.width/2+", "+(_+a/2)+")");const T=I.rectangle(D,_,F,z,Y),k=h.insert(()=>T,":first-child").attr("style",o.join("")),{themeVariables:S}=gr(),{rowEven:M,rowOdd:W,nodeBorder:N}=S;d.push(0);for(const[K,at]of p.entries()){const wt=(K+1)%2===0&&at.yOffset!==0,_t=I.rectangle(D,u.height+_+(at==null?void 0:at.yOffset),F,at==null?void 0:at.rowHeight,{...Y,fill:wt?M:W,stroke:N});h.insert(()=>_t,"g.label").attr("style",o.join("")).attr("class",`row-rect-${wt?"even":"odd"}`)}let O=I.line(D,u.height+_,F+D,u.height+_,Y);h.insert(()=>O).attr("class","divider"),O=I.line(g+D,u.height+_,g+D,z+_,Y),h.insert(()=>O).attr("class","divider"),C&&(O=I.line(g+b+D,u.height+_,g+b+D,z+_,Y),h.insert(()=>O).attr("class","divider")),A&&(O=I.line(g+b+y+D,u.height+_,g+b+y+D,z+_,Y),h.insert(()=>O).attr("class","divider"));for(const K of d)O=I.line(D,u.height+_+K,F+D,u.height+_+K,Y),h.insert(()=>O).attr("class","divider");if(It(t,k),c&&t.look!=="handDrawn"){const K=c.split(";"),at=(J=K==null?void 0:K.filter(lt=>lt.includes("stroke")))==null?void 0:J.map(lt=>`${lt}`).join("; ");h.selectAll("path").attr("style",at??""),h.selectAll(".row-rect-even path").attr("style",c)}return t.intersect=function(K){return vt.rect(t,K)},h}m($u,"erBox");async function Bn(e,t,r,i=0,n=0,a=[],o=""){const s=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",o);t!==Kd(t)&&(t=Kd(t),t=t.replaceAll("<","<").replaceAll(">",">"));const c=s.node().appendChild(await Ui(s,t,{width:Li(t,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=c.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let l=c.getBBox();if(nr(r.htmlLabels)){const h=c.children[0];h.style.textAlign="start";const u=se(c);l=h.getBoundingClientRect(),u.attr("width",l.width),u.attr("height",l.height)}return l}m(Bn,"addText");async function gx(e,t,r,i,n=r.class.padding??12){const a=i?0:3,o=e.insert("g").attr("class",Vt(t)).attr("id",t.domId||t.id);let s=null,c=null,l=null,h=null,u=0,f=0,d=0;if(s=o.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const x=t.annotations[0];await Fa(s,{text:`«${x}»`},0),u=s.node().getBBox().height}c=o.insert("g").attr("class","label-group text"),await Fa(c,t,0,["font-weight: bolder"]);const p=c.node().getBBox();f=p.height,l=o.insert("g").attr("class","members-group text");let g=0;for(const x of t.members){const C=await Fa(l,x,g,[x.parseClassifier()]);g+=C+a}d=l.node().getBBox().height,d<=0&&(d=n/2),h=o.insert("g").attr("class","methods-group text");let b=0;for(const x of t.methods){const C=await Fa(h,x,b,[x.parseClassifier()]);b+=C+a}let y=o.node().getBBox();if(s!==null){const x=s.node().getBBox();s.attr("transform",`translate(${-x.width/2})`)}return c.attr("transform",`translate(${-p.width/2}, ${u})`),y=o.node().getBBox(),l.attr("transform",`translate(0, ${u+f+n*2})`),y=o.node().getBBox(),h.attr("transform",`translate(0, ${u+f+(d?d+n*4:n*2)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}m(gx,"textHelper");async function Fa(e,t,r,i=[]){const n=e.insert("g").attr("class","label").attr("style",i.join("; ")),a=gr();let o="useHtmlLabels"in t?t.useHtmlLabels:nr(a.htmlLabels)??!0,s="";"text"in t?s=t.text:s=t.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),ta(s)&&(o=!0);const c=await Ui(n,tu(Tn(s)),{width:Li(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let l,h=1;if(o){const u=c.children[0],f=se(c);h=u.innerHTML.split("<br>").length,u.innerHTML.includes("</math>")&&(h+=u.innerHTML.split("<mrow>").length-1);const d=u.getElementsByTagName("img");if(d){const p=s.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...d].map(g=>new Promise(b=>{function y(){var x;if(g.style.display="flex",g.style.flexDirection="column",p){const C=((x=a.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,B=parseInt(C,10)*5+"px";g.style.minWidth=B,g.style.maxWidth=B}else g.style.width="100%";b(g)}m(y,"setupImage"),setTimeout(()=>{g.complete&&y()}),g.addEventListener("error",y),g.addEventListener("load",y)})))}l=u.getBoundingClientRect(),f.attr("width",l.width),f.attr("height",l.height)}else{i.includes("font-weight: bolder")&&se(c).selectAll("tspan").attr("font-weight",""),h=c.children.length;const u=c.children[0];(c.textContent===""||c.textContent.includes(">"))&&(u.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[1]===" "&&(u.textContent=u.textContent[0]+" "+u.textContent.substring(1))),u.textContent==="undefined"&&(u.textContent=""),l=c.getBBox()}return n.attr("transform","translate(0,"+(-l.height/(2*h)+r)+")"),l.height}m(Fa,"addText");async function mx(e,t){var Y,q;const r=Re(),i=r.class.padding??12,n=i,a=t.useHtmlLabels??nr(r.htmlLabels)??!0,o=t;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:s,bbox:c}=await gx(e,t,r,a,n),{labelStyles:l,nodeStyles:h}=Ot(t);t.labelStyle=l,t.cssStyles=o.styles||"";const u=((Y=o.styles)==null?void 0:Y.join(";"))||h||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const f=o.members.length===0&&o.methods.length===0&&!((q=r.class)!=null&&q.hideEmptyMembersBox),d=$t.svg(s),p=Rt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=c.width;let b=c.height;o.members.length===0&&o.methods.length===0?b+=n:o.members.length>0&&o.methods.length===0&&(b+=n*2);const y=-g/2,x=-b/2,C=d.rectangle(y-i,x-i-(f?i:o.members.length===0&&o.methods.length===0?-i/2:0),g+2*i,b+2*i+(f?i*2:o.members.length===0&&o.methods.length===0?-i:0),p),A=s.insert(()=>C,":first-child");A.attr("class","basic label-container");const B=A.node().getBBox();s.selectAll(".text").each((F,z,D)=>{var W;const _=se(D[z]),T=_.attr("transform");let k=0;if(T){const O=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(T);O&&(k=parseFloat(O[2]))}let S=k+x+i-(f?i:o.members.length===0&&o.methods.length===0?-i/2:0);a||(S-=4);let M=y;(_.attr("class").includes("label-group")||_.attr("class").includes("annotation-group"))&&(M=-((W=_.node())==null?void 0:W.getBBox().width)/2||0,s.selectAll("text").each(function(N,O,j){window.getComputedStyle(j[O]).textAnchor==="middle"&&(M=0)})),_.attr("transform",`translate(${M}, ${S})`)});const w=s.select(".annotation-group").node().getBBox().height-(f?i/2:0)||0,E=s.select(".label-group").node().getBBox().height-(f?i/2:0)||0,I=s.select(".members-group").node().getBBox().height-(f?i/2:0)||0;if(o.members.length>0||o.methods.length>0||f){const F=d.line(B.x,w+E+x+i,B.x+B.width,w+E+x+i,p);s.insert(()=>F).attr("class","divider").attr("style",u)}if(f||o.members.length>0||o.methods.length>0){const F=d.line(B.x,w+E+I+x+n*2+i,B.x+B.width,w+E+I+x+i+n*2,p);s.insert(()=>F).attr("class","divider").attr("style",u)}if(o.look!=="handDrawn"&&s.selectAll("path").attr("style",u),A.select(":nth-child(2)").attr("style",u),s.selectAll(".divider").select("path").attr("style",u),t.labelStyle?s.selectAll("span").attr("style",t.labelStyle):s.selectAll("span").attr("style",u),!a){const F=RegExp(/color\s*:\s*([^;]*)/),z=F.exec(u);if(z){const D=z[0].replace("color","fill");s.selectAll("tspan").attr("style",D)}else if(l){const D=F.exec(l);if(D){const _=D[0].replace("color","fill");s.selectAll("tspan").attr("style",_)}}}return It(t,A),t.intersect=function(F){return vt.rect(t,F)},s}m(mx,"classBox");async function bx(e,t){var w,E;const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const n=t,a=t,o=20,s=20,c="verifyMethod"in t,l=Vt(t),h=e.insert("g").attr("class",l).attr("id",t.domId??t.id);let u;c?u=await hi(h,`<<${n.type}>>`,0,t.labelStyle):u=await hi(h,"<<Element>>",0,t.labelStyle);let f=u;const d=await hi(h,n.name,f,t.labelStyle+"; font-weight: bold;");if(f+=d+s,c){const I=await hi(h,`${n.requirementId?`ID: ${n.requirementId}`:""}`,f,t.labelStyle);f+=I;const Y=await hi(h,`${n.text?`Text: ${n.text}`:""}`,f,t.labelStyle);f+=Y;const q=await hi(h,`${n.risk?`Risk: ${n.risk}`:""}`,f,t.labelStyle);f+=q,await hi(h,`${n.verifyMethod?`Verification: ${n.verifyMethod}`:""}`,f,t.labelStyle)}else{const I=await hi(h,`${a.type?`Type: ${a.type}`:""}`,f,t.labelStyle);f+=I,await hi(h,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,f,t.labelStyle)}const p=(((w=h.node())==null?void 0:w.getBBox().width)??200)+o,g=(((E=h.node())==null?void 0:E.getBBox().height)??200)+o,b=-p/2,y=-g/2,x=$t.svg(h),C=Rt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const A=x.rectangle(b,y,p,g,C),B=h.insert(()=>A,":first-child");if(B.attr("class","basic label-container").attr("style",i),h.selectAll(".label").each((I,Y,q)=>{const F=se(q[Y]),z=F.attr("transform");let D=0,_=0;if(z){const M=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);M&&(D=parseFloat(M[1]),_=parseFloat(M[2]))}const T=_-g/2;let k=b+o/2;(Y===0||Y===1)&&(k=D),F.attr("transform",`translate(${k}, ${T+o})`)}),f>u+d+s){const I=x.line(b,y+u+d+s,b+p,y+u+d+s,C);h.insert(()=>I).attr("style",i)}return It(t,B),t.intersect=function(I){return vt.rect(t,I)},h}m(bx,"requirementBox");async function hi(e,t,r,i=""){if(t==="")return 0;const n=e.insert("g").attr("class","label").attr("style",i),a=Re(),o=a.htmlLabels??!0,s=await Ui(n,tu(Tn(t)),{width:Li(t,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:i},a);let c;if(o){const l=s.children[0],h=se(s);c=l.getBoundingClientRect(),h.attr("width",c.width),h.attr("height",c.height)}else{const l=s.children[0];for(const h of l.children)h.textContent=h.textContent.replaceAll(">",">").replaceAll("<","<"),i&&h.setAttribute("style",i);c=s.getBBox(),c.height+=6}return n.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}m(hi,"addText");var IR=m(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function yx(e,t,{config:r}){var z,D;const{labelStyles:i,nodeStyles:n}=Ot(t);t.labelStyle=i||"";const a=10,o=t.width;t.width=(t.width??200)-10;const{shapeSvg:s,bbox:c,label:l}=await Xt(e,t,Vt(t)),h=t.padding||10;let u="",f;"ticket"in t&&t.ticket&&((z=r==null?void 0:r.kanban)!=null&&z.ticketBaseUrl)&&(u=(D=r==null?void 0:r.kanban)==null?void 0:D.ticketBaseUrl.replace("#TICKET#",t.ticket),f=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",u).attr("target","_blank"));const d={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,g;f?{label:p,bbox:g}=await oc(f,"ticket"in t&&t.ticket||"",d):{label:p,bbox:g}=await oc(s,"ticket"in t&&t.ticket||"",d);const{label:b,bbox:y}=await oc(s,"assigned"in t&&t.assigned||"",d);t.width=o;const x=10,C=(t==null?void 0:t.width)||0,A=Math.max(g.height,y.height)/2,B=Math.max(c.height+x*2,(t==null?void 0:t.height)||0)+A,w=-C/2,E=-B/2;l.attr("transform","translate("+(h-C/2)+", "+(-A-c.height/2)+")"),p.attr("transform","translate("+(h-C/2)+", "+(-A+c.height/2)+")"),b.attr("transform","translate("+(h+C/2-y.width-2*a)+", "+(-A+c.height/2)+")");let I;const{rx:Y,ry:q}=t,{cssStyles:F}=t;if(t.look==="handDrawn"){const _=$t.svg(s),T=Rt(t,{}),k=Y||q?_.path(Gi(w,E,C,B,Y||0),T):_.rectangle(w,E,C,B,T);I=s.insert(()=>k,":first-child"),I.attr("class","basic label-container").attr("style",F||null)}else{I=s.insert("rect",":first-child"),I.attr("class","basic label-container __APA__").attr("style",n).attr("rx",Y??5).attr("ry",q??5).attr("x",w).attr("y",E).attr("width",C).attr("height",B);const _="priority"in t&&t.priority;if(_){const T=s.append("line"),k=w+2,S=E+Math.floor((Y??0)/2),M=E+B-Math.floor((Y??0)/2);T.attr("x1",k).attr("y1",S).attr("x2",k).attr("y2",M).attr("stroke-width","4").attr("stroke",IR(_))}}return It(t,I),t.height=B,t.intersect=function(_){return vt.rect(t,_)},s}m(yx,"kanbanItem");async function xx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o,label:s}=await Xt(e,t,Vt(t)),c=a.width+10*o,l=a.height+8*o,h=.15*c,{cssStyles:u}=t,f=a.width+20,d=a.height+20,p=Math.max(c,f),g=Math.max(l,d);s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let b;const y=`M0 0
|
|
272
|
+
a${h},${h} 1 0,0 ${p*.25},${-1*g*.1}
|
|
273
|
+
a${h},${h} 1 0,0 ${p*.25},0
|
|
274
|
+
a${h},${h} 1 0,0 ${p*.25},0
|
|
275
|
+
a${h},${h} 1 0,0 ${p*.25},${g*.1}
|
|
276
|
+
|
|
277
|
+
a${h},${h} 1 0,0 ${p*.15},${g*.33}
|
|
278
|
+
a${h*.8},${h*.8} 1 0,0 0,${g*.34}
|
|
279
|
+
a${h},${h} 1 0,0 ${-1*p*.15},${g*.33}
|
|
280
|
+
|
|
281
|
+
a${h},${h} 1 0,0 ${-1*p*.25},${g*.15}
|
|
282
|
+
a${h},${h} 1 0,0 ${-1*p*.25},0
|
|
283
|
+
a${h},${h} 1 0,0 ${-1*p*.25},0
|
|
284
|
+
a${h},${h} 1 0,0 ${-1*p*.25},${-1*g*.15}
|
|
285
|
+
|
|
286
|
+
a${h},${h} 1 0,0 ${-1*p*.1},${-1*g*.33}
|
|
287
|
+
a${h*.8},${h*.8} 1 0,0 0,${-1*g*.34}
|
|
288
|
+
a${h},${h} 1 0,0 ${p*.1},${-1*g*.33}
|
|
289
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const x=$t.svg(n),C=Rt(t,{}),A=x.path(y,C);b=n.insert(()=>A,":first-child"),b.attr("class","basic label-container").attr("style",br(u))}else b=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return b.attr("transform",`translate(${-p/2}, ${-g/2})`),It(t,b),t.calcIntersect=function(x,C){return vt.rect(x,C)},t.intersect=function(x){return rt.info("Bang intersect",t,x),vt.rect(t,x)},n}m(xx,"bang");async function vx(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o,label:s}=await Xt(e,t,Vt(t)),c=a.width+2*o,l=a.height+2*o,h=.15*c,u=.25*c,f=.35*c,d=.2*c,{cssStyles:p}=t;let g;const b=`M0 0
|
|
290
|
+
a${h},${h} 0 0,1 ${c*.25},${-1*c*.1}
|
|
291
|
+
a${f},${f} 1 0,1 ${c*.4},${-1*c*.1}
|
|
292
|
+
a${u},${u} 1 0,1 ${c*.35},${c*.2}
|
|
293
|
+
|
|
294
|
+
a${h},${h} 1 0,1 ${c*.15},${l*.35}
|
|
295
|
+
a${d},${d} 1 0,1 ${-1*c*.15},${l*.65}
|
|
296
|
+
|
|
297
|
+
a${u},${h} 1 0,1 ${-1*c*.25},${c*.15}
|
|
298
|
+
a${f},${f} 1 0,1 ${-1*c*.5},0
|
|
299
|
+
a${h},${h} 1 0,1 ${-1*c*.25},${-1*c*.15}
|
|
300
|
+
|
|
301
|
+
a${h},${h} 1 0,1 ${-1*c*.1},${-1*l*.35}
|
|
302
|
+
a${d},${d} 1 0,1 ${c*.1},${-1*l*.65}
|
|
303
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const y=$t.svg(n),x=Rt(t,{}),C=y.path(b,x);g=n.insert(()=>C,":first-child"),g.attr("class","basic label-container").attr("style",br(p))}else g=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",b);return s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),g.attr("transform",`translate(${-c/2}, ${-l/2})`),It(t,g),t.calcIntersect=function(y,x){return vt.rect(y,x)},t.intersect=function(y){return rt.info("Cloud intersect",t,y),vt.rect(t,y)},n}m(vx,"cloud");async function _x(e,t){const{labelStyles:r,nodeStyles:i}=Ot(t);t.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o,label:s}=await Xt(e,t,Vt(t)),c=a.width+8*o,l=a.height+2*o,h=5,u=`
|
|
304
|
+
M${-c/2} ${l/2-h}
|
|
305
|
+
v${-l+2*h}
|
|
306
|
+
q0,-${h} ${h},-${h}
|
|
307
|
+
h${c-2*h}
|
|
308
|
+
q${h},0 ${h},${h}
|
|
309
|
+
v${l-2*h}
|
|
310
|
+
q0,${h} -${h},${h}
|
|
311
|
+
h${-c+2*h}
|
|
312
|
+
q-${h},0 -${h},-${h}
|
|
313
|
+
Z
|
|
314
|
+
`,f=n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return n.append("line").attr("class","node-line-").attr("x1",-c/2).attr("y1",l/2).attr("x2",c/2).attr("y2",l/2),s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),n.append(()=>s.node()),It(t,f),t.calcIntersect=function(d,p){return vt.rect(d,p)},t.intersect=function(d){return vt.rect(t,d)},n}m(_x,"defaultMindmapNode");async function kx(e,t){const r={padding:t.padding??0};return Bu(e,t,r)}m(kx,"mindmapCircle");var DR=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Jy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Zy},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:tx},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:nx},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:wy},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Bu},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:xx},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:vx},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Yy},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ly},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:zy},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Py},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:cx},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Dy},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Sy},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:ox},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:gy},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ky},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:ix},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:rx},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Ay},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:By},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:xy},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:vy},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:_y},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Wy},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:dx},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:My},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:lx},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:qy},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ky},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Cy},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:ux},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:px},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ty},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:hx},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Ey},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Qy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Uy},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:jy},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:py},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:yy},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:sx},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ax},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:fx},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Vy},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Hy}],FR=m(()=>{const t=[...Object.entries({state:ex,choice:my,note:Gy,rectWithTitle:Xy,labelRect:Fy,iconSquare:Ny,iconCircle:Ry,icon:$y,iconRounded:Oy,imageSquare:Iy,anchor:fy,kanbanItem:yx,mindmapCircle:kx,defaultMindmapNode:_x,classBox:mx,erBox:$u,requirementBox:bx}),...DR.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(n=>[n,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),wx=FR();function PR(e){return e in wx}m(PR,"isValidShape");var Tl=new Map;async function Cx(e,t,r){let i,n;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?wx[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),n=await a(i,t,r)}else n=await a(e,t,r),i=n;return t.tooltip&&n.attr("title",t.tooltip),Tl.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}m(Cx,"insertNode");var DD=m((e,t)=>{Tl.set(t.id,e)},"setNodeElem"),FD=m(()=>{Tl.clear()},"clear"),PD=m(e=>{const t=Tl.get(e.id);rt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),zR=m((e,t,r,i,n,a)=>{t.arrowTypeStart&&Pf(e,"start",t.arrowTypeStart,r,i,n,a),t.arrowTypeEnd&&Pf(e,"end",t.arrowTypeEnd,r,i,n,a)},"addEdgeMarkers"),WR={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},Pf=m((e,t,r,i,n,a,o)=>{var u;const s=WR[r];if(!s){rt.warn(`Unknown arrow type: ${r}`);return}const c=s.type,h=`${n}_${a}-${c}${t==="start"?"Start":"End"}`;if(o&&o.trim()!==""){const f=o.replace(/[^\dA-Za-z]/g,"_"),d=`${h}_${f}`;if(!document.getElementById(d)){const p=document.getElementById(h);if(p){const g=p.cloneNode(!0);g.id=d,g.querySelectorAll("path, circle, line").forEach(y=>{y.setAttribute("stroke",o),s.fill&&y.setAttribute("fill",o)}),(u=p.parentNode)==null||u.appendChild(g)}}e.attr(`marker-${t}`,`url(${i}#${d})`)}else e.attr(`marker-${t}`,`url(${i}#${h})`)},"addEdgeMarker"),Zo=new Map,cr=new Map,zD=m(()=>{Zo.clear(),cr.clear()},"clear"),Ps=m(e=>e?e.reduce((r,i)=>r+";"+i,""):"","getLabelStyles"),qR=m(async(e,t)=>{let r=nr(Re().flowchart.htmlLabels);const{labelStyles:i}=Ot(t);t.labelStyle=i;const n=await Ui(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});rt.info("abc82",t,t.labelType);const a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",t.id);o.node().appendChild(n);let s=n.getBBox();if(r){const l=n.children[0],h=se(n);s=l.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}o.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),Zo.set(t.id,a),t.width=s.width,t.height=s.height;let c;if(t.startLabelLeft){const l=await hn(t.startLabelLeft,Ps(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");c=u.node().appendChild(l);const f=l.getBBox();u.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),cr.get(t.id)||cr.set(t.id,{}),cr.get(t.id).startLeft=h,Pa(c,t.startLabelLeft)}if(t.startLabelRight){const l=await hn(t.startLabelRight,Ps(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");c=h.node().appendChild(l),u.node().appendChild(l);const f=l.getBBox();u.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),cr.get(t.id)||cr.set(t.id,{}),cr.get(t.id).startRight=h,Pa(c,t.startLabelRight)}if(t.endLabelLeft){const l=await hn(t.endLabelLeft,Ps(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");c=u.node().appendChild(l);const f=l.getBBox();u.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(l),cr.get(t.id)||cr.set(t.id,{}),cr.get(t.id).endLeft=h,Pa(c,t.endLabelLeft)}if(t.endLabelRight){const l=await hn(t.endLabelRight,Ps(t.labelStyle)),h=e.insert("g").attr("class","edgeTerminals"),u=h.insert("g").attr("class","inner");c=u.node().appendChild(l);const f=l.getBBox();u.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(l),cr.get(t.id)||cr.set(t.id,{}),cr.get(t.id).endRight=h,Pa(c,t.endLabelRight)}return n},"insertEdgeLabel");function Pa(e,t){Re().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}m(Pa,"setTerminalWidth");var HR=m((e,t)=>{rt.debug("Moving label abc88 ",e.id,e.label,Zo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=Re(),{subGraphTitleTotalMargin:n}=lu(i);if(e.label){const a=Zo.get(e.id);let o=e.x,s=e.y;if(r){const c=Jr.calcLabelPosition(r);rt.debug("Moving label "+e.label+" from (",o,",",s,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(o=c.x,s=c.y)}a.attr("transform",`translate(${o}, ${s+n/2})`)}if(e.startLabelLeft){const a=cr.get(e.id).startLeft;let o=e.x,s=e.y;if(r){const c=Jr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.startLabelRight){const a=cr.get(e.id).startRight;let o=e.x,s=e.y;if(r){const c=Jr.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelLeft){const a=cr.get(e.id).endLeft;let o=e.x,s=e.y;if(r){const c=Jr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}if(e.endLabelRight){const a=cr.get(e.id).endRight;let o=e.x,s=e.y;if(r){const c=Jr.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=c.x,s=c.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),jR=m((e,t)=>{const r=e.x,i=e.y,n=Math.abs(t.x-r),a=Math.abs(t.y-i),o=e.width/2,s=e.height/2;return n>=o||a>=s},"outsideNode"),UR=m((e,t,r)=>{rt.debug(`intersection calc abc89:
|
|
315
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
316
|
+
insidePoint : ${JSON.stringify(r)}
|
|
317
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,n=e.y,a=Math.abs(i-r.x),o=e.width/2;let s=r.x<t.x?o-a:o+a;const c=e.height/2,l=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(n-t.y)*o>Math.abs(i-t.x)*c){let u=r.y<t.y?t.y-c-n:n-c-t.y;s=h*u/l;const f={x:r.x<t.x?r.x+s:r.x-h+s,y:r.y<t.y?r.y+l-u:r.y-l+u};return s===0&&(f.x=t.x,f.y=t.y),h===0&&(f.x=t.x),l===0&&(f.y=t.y),rt.debug(`abc89 top/bottom calc, Q ${l}, q ${u}, R ${h}, r ${s}`,f),f}else{r.x<t.x?s=t.x-o-i:s=i-o-t.x;let u=l*s/h,f=r.x<t.x?r.x+h-s:r.x-h+s,d=r.y<t.y?r.y+u:r.y-u;return rt.debug(`sides calc abc89, Q ${l}, q ${u}, R ${h}, r ${s}`,{_x:f,_y:d}),s===0&&(f=t.x,d=t.y),h===0&&(f=t.x),l===0&&(d=t.y),{x:f,y:d}}},"intersection"),zf=m((e,t)=>{rt.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],n=!1;return e.forEach(a=>{if(rt.info("abc88 checking point",a,t),!jR(t,a)&&!n){const o=UR(t,i,a);rt.debug("abc88 inside",a,i,o),rt.debug("abc88 intersection",o,t);let s=!1;r.forEach(c=>{s=s||c.x===o.x&&c.y===o.y}),r.some(c=>c.x===o.x&&c.y===o.y)?rt.warn("abc88 no intersect",o,r):r.push(o),n=!0}else rt.warn("abc88 outside",a,i),i=a,n||r.push(a)}),rt.debug("returning points",r),r},"cutPathAtIntersect");function Sx(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const n=e[i-1],a=e[i],o=e[i+1];(n.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-n.y)>5||n.y===a.y&&a.x===o.x&&Math.abs(a.x-n.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}m(Sx,"extractCornerPoints");var Wf=m(function(e,t,r){const i=t.x-e.x,n=t.y-e.y,a=Math.sqrt(i*i+n*n),o=r/a;return{x:t.x-o*i,y:t.y-o*n}},"findAdjacentPoint"),GR=m(function(e){const{cornerPointPositions:t}=Sx(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const n=e[i-1],a=e[i+1],o=e[i],s=Wf(n,o,5),c=Wf(a,o,5),l=c.x-s.x,h=c.y-s.y;r.push(s);const u=Math.sqrt(2)*2;let f={x:o.x,y:o.y};if(Math.abs(a.x-n.x)>10&&Math.abs(a.y-n.y)>=10){rt.debug("Corner point fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));const d=5;o.x===s.x?f={x:l<0?s.x-d+u:s.x+d-u,y:h<0?s.y-u:s.y+u}:f={x:l<0?s.x-u:s.x+u,y:h<0?s.y-d+u:s.y+d-u}}else rt.debug("Corner point skipping fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));r.push(f,c)}else r.push(e[i]);return r},"fixCorners"),YR=m((e,t,r)=>{const i=e-t-r,n=2,a=2,o=n+a,s=Math.floor(i/o),c=Array(s).fill(`${n} ${a}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),VR=m(function(e,t,r,i,n,a,o,s=!1){var _;const{handDrawnSeed:c}=Re();let l=t.points,h=!1;const u=n;var f=a;const d=[];for(const T in t.cssCompiledStyles)rb(T)||d.push(t.cssCompiledStyles[T]);rt.debug("UIO intersect check",t.points,f.x,u.x),f.intersect&&u.intersect&&!s&&(l=l.slice(1,t.points.length-1),l.unshift(u.intersect(l[0])),rt.debug("Last point UIO",t.start,"-->",t.end,l[l.length-1],f,f.intersect(l[l.length-1])),l.push(f.intersect(l[l.length-1])));const p=btoa(JSON.stringify(l));t.toCluster&&(rt.info("to cluster abc88",r.get(t.toCluster)),l=zf(t.points,r.get(t.toCluster).node),h=!0),t.fromCluster&&(rt.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(l,null,2)),l=zf(l.reverse(),r.get(t.fromCluster).node).reverse(),h=!0);let g=l.filter(T=>!Number.isNaN(T.y));g=GR(g);let b=Zs;switch(b=yo,t.curve){case"linear":b=yo;break;case"basis":b=Zs;break;case"cardinal":b=dg;break;case"bumpX":b=og;break;case"bumpY":b=lg;break;case"catmullRom":b=pg;break;case"monotoneX":b=vg;break;case"monotoneY":b=_g;break;case"natural":b=wg;break;case"step":b=Cg;break;case"stepAfter":b=Tg;break;case"stepBefore":b=Sg;break;default:b=Zs}const{x:y,y:x}=GM(t),C=G2().x(y).y(x).curve(b);let A;switch(t.thickness){case"normal":A="edge-thickness-normal";break;case"thick":A="edge-thickness-thick";break;case"invisible":A="edge-thickness-invisible";break;default:A="edge-thickness-normal"}switch(t.pattern){case"solid":A+=" edge-pattern-solid";break;case"dotted":A+=" edge-pattern-dotted";break;case"dashed":A+=" edge-pattern-dashed";break;default:A+=" edge-pattern-solid"}let B,w=t.curve==="rounded"?Tx(Ex(g,t),5):C(g);const E=Array.isArray(t.style)?t.style:[t.style];let I=E.find(T=>T==null?void 0:T.startsWith("stroke:")),Y=!1;if(t.look==="handDrawn"){const T=$t.svg(e);Object.assign([],g);const k=T.path(w,{roughness:.3,seed:c});A+=" transition",B=se(k).select("path").attr("id",t.id).attr("class"," "+A+(t.classes?" "+t.classes:"")).attr("style",E?E.reduce((M,W)=>M+";"+W,""):"");let S=B.attr("d");B.attr("d",S),e.node().appendChild(B.node())}else{const T=d.join(";"),k=E?E.reduce((G,X)=>G+X+";",""):"";let S="";t.animate&&(S=" edge-animation-fast"),t.animation&&(S=" edge-animation-"+t.animation);const M=(T?T+";"+k+";":k)+";"+(E?E.reduce((G,X)=>G+";"+X,""):"");B=e.append("path").attr("d",w).attr("id",t.id).attr("class"," "+A+(t.classes?" "+t.classes:"")+(S??"")).attr("style",M),I=(_=M.match(/stroke:([^;]+)/))==null?void 0:_[1],Y=t.animate===!0||!!t.animation||T.includes("animation");const W=B.node(),N=typeof W.getTotalLength=="function"?W.getTotalLength():0,O=rf[t.arrowTypeStart]||0,j=rf[t.arrowTypeEnd]||0;if(t.look==="neo"&&!Y){const X=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?YR(N,O,j):`0 ${O} ${N-O-j} ${j}`}; stroke-dashoffset: 0;`;B.attr("style",X+B.attr("style"))}}B.attr("data-edge",!0),B.attr("data-et","edge"),B.attr("data-id",t.id),B.attr("data-points",p),t.showPoints&&g.forEach(T=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",T.x).attr("cy",T.y)});let q="";(Re().flowchart.arrowMarkerAbsolute||Re().state.arrowMarkerAbsolute)&&(q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,q=q.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),rt.info("arrowTypeStart",t.arrowTypeStart),rt.info("arrowTypeEnd",t.arrowTypeEnd),zR(B,t,q,o,i,I);const F=Math.floor(l.length/2),z=l[F];Jr.isLabelCoordinateInPath(z,B.attr("d"))||(h=!0);let D={};return h&&(D.updatedPath=l),D.originalPath=t.points,D},"insertEdge");function Tx(e,t){if(e.length<2)return"";let r="";const i=e.length,n=1e-5;for(let a=0;a<i;a++){const o=e[a],s=e[a-1],c=e[a+1];if(a===0)r+=`M${o.x},${o.y}`;else if(a===i-1)r+=`L${o.x},${o.y}`;else{const l=o.x-s.x,h=o.y-s.y,u=c.x-o.x,f=c.y-o.y,d=Math.hypot(l,h),p=Math.hypot(u,f);if(d<n||p<n){r+=`L${o.x},${o.y}`;continue}const g=l/d,b=h/d,y=u/p,x=f/p,C=g*y+b*x,A=Math.max(-1,Math.min(1,C)),B=Math.acos(A);if(B<n||Math.abs(Math.PI-B)<n){r+=`L${o.x},${o.y}`;continue}const w=Math.min(t/Math.sin(B/2),d/2,p/2),E=o.x-g*w,I=o.y-b*w,Y=o.x+y*w,q=o.y+x*w;r+=`L${E},${I}`,r+=`Q${o.x},${o.y} ${Y},${q}`}}return r}m(Tx,"generateRoundedPath");function lh(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}m(lh,"calculateDeltaAndAngle");function Ex(e,t){const r=e.map(n=>({...n}));if(e.length>=2&&pr[t.arrowTypeStart]){const n=pr[t.arrowTypeStart],a=e[0],o=e[1],{angle:s}=lh(a,o),c=n*Math.cos(s),l=n*Math.sin(s);r[0].x=a.x+c,r[0].y=a.y+l}const i=e.length;if(i>=2&&pr[t.arrowTypeEnd]){const n=pr[t.arrowTypeEnd],a=e[i-1],o=e[i-2],{angle:s}=lh(o,a),c=n*Math.cos(s),l=n*Math.sin(s);r[i-1].x=a.x-c,r[i-1].y=a.y-l}return r}m(Ex,"applyMarkerOffsetsToPoints");var XR=m((e,t,r,i)=>{t.forEach(n=>{u5[n](e,r,i)})},"insertMarkers"),ZR=m((e,t,r)=>{rt.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),KR=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),QR=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),JR=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),t5=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),e5=m((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),r5=m((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),i5=m((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),n5=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),a5=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),s5=m((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),o5=m((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),l5=m((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),c5=m((e,t,r)=>{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").append("path").attr("d",`M0,0
|
|
318
|
+
L20,10
|
|
319
|
+
M20,10
|
|
320
|
+
L0,20`)},"requirement_arrow"),h5=m((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"),u5={extension:ZR,composition:KR,aggregation:QR,dependency:JR,lollipop:t5,point:e5,circle:r5,cross:i5,barb:n5,only_one:a5,zero_or_one:s5,one_or_more:o5,zero_or_more:l5,requirement_arrow:c5,requirement_contains:h5},d5=XR,f5={common:sa,getConfig:gr,insertCluster:_R,insertEdge:VR,insertEdgeLabel:qR,insertMarkers:d5,insertNode:Cx,interpolateToCurve:fu,labelHelper:Xt,log:rt,positionEdgeLabel:HR},cs={},Ax=m(e=>{for(const t of e)cs[t.name]=t},"registerLayoutLoaders"),p5=m(()=>{Ax([{name:"dagre",loader:m(async()=>await Ne(()=>import("./BRcwIQNr.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"loader")},{name:"cose-bilkent",loader:m(async()=>await Ne(()=>import("./6RxdMKe4.js"),__vite__mapDeps([6,7]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");p5();var WD=m(async(e,t)=>{if(!(e.layoutAlgorithm in cs))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=cs[e.layoutAlgorithm];return(await r.loader()).render(e,t,f5,{algorithm:r.algorithm})},"render"),qD=m((e="",{fallback:t="dagre"}={})=>{if(e in cs)return e;if(t in cs)return rt.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"),Mx="comm",Lx="rule",Bx="decl",g5="@import",m5="@namespace",b5="@keyframes",y5="@layer",$x=Math.abs,Ru=String.fromCharCode;function Rx(e){return e.trim()}function ao(e,t,r){return e.replace(t,r)}function x5(e,t,r){return e.indexOf(t,r)}function Pn(e,t){return e.charCodeAt(t)|0}function ia(e,t,r){return e.slice(t,r)}function ui(e){return e.length}function v5(e){return e.length}function zs(e,t){return t.push(e),e}var El=1,na=1,Ox=0,jr=0,Ke=0,ua="";function Ou(e,t,r,i,n,a,o,s){return{value:e,root:t,parent:r,type:i,props:n,children:a,line:El,column:na,length:o,return:"",siblings:s}}function _5(){return Ke}function k5(){return Ke=jr>0?Pn(ua,--jr):0,na--,Ke===10&&(na=1,El--),Ke}function ei(){return Ke=jr<Ox?Pn(ua,jr++):0,na++,Ke===10&&(na=1,El++),Ke}function Fi(){return Pn(ua,jr)}function so(){return jr}function Al(e,t){return ia(ua,e,t)}function hs(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function w5(e){return El=na=1,Ox=ui(ua=e),jr=0,[]}function C5(e){return ua="",e}function lc(e){return Rx(Al(jr-1,ch(e===91?e+2:e===40?e+1:e)))}function S5(e){for(;(Ke=Fi())&&Ke<33;)ei();return hs(e)>2||hs(Ke)>3?"":" "}function T5(e,t){for(;--t&&ei()&&!(Ke<48||Ke>102||Ke>57&&Ke<65||Ke>70&&Ke<97););return Al(e,so()+(t<6&&Fi()==32&&ei()==32))}function ch(e){for(;ei();)switch(Ke){case e:return jr;case 34:case 39:e!==34&&e!==39&&ch(Ke);break;case 40:e===41&&ch(e);break;case 92:ei();break}return jr}function E5(e,t){for(;ei()&&e+Ke!==57;)if(e+Ke===84&&Fi()===47)break;return"/*"+Al(t,jr-1)+"*"+Ru(e===47?e:ei())}function A5(e){for(;!hs(Fi());)ei();return Al(e,jr)}function M5(e){return C5(oo("",null,null,null,[""],e=w5(e),0,[0],e))}function oo(e,t,r,i,n,a,o,s,c){for(var l=0,h=0,u=o,f=0,d=0,p=0,g=1,b=1,y=1,x=0,C="",A=n,B=a,w=i,E=C;b;)switch(p=x,x=ei()){case 40:if(p!=108&&Pn(E,u-1)==58){x5(E+=ao(lc(x),"&","&\f"),"&\f",$x(l?s[l-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:E+=lc(x);break;case 9:case 10:case 13:case 32:E+=S5(p);break;case 92:E+=T5(so()-1,7);continue;case 47:switch(Fi()){case 42:case 47:zs(L5(E5(ei(),so()),t,r,c),c),(hs(p||1)==5||hs(Fi()||1)==5)&&ui(E)&&ia(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*g:s[l++]=ui(E)*y;case 125*g:case 59:case 0:switch(x){case 0:case 125:b=0;case 59+h:y==-1&&(E=ao(E,/\f/g,"")),d>0&&(ui(E)-u||g===0&&p===47)&&zs(d>32?Hf(E+";",i,r,u-1,c):Hf(ao(E," ","")+";",i,r,u-2,c),c);break;case 59:E+=";";default:if(zs(w=qf(E,t,r,l,h,n,s,C,A=[],B=[],u,a),a),x===123)if(h===0)oo(E,t,w,w,A,a,u,s,B);else{switch(f){case 99:if(Pn(E,3)===110)break;case 108:if(Pn(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?oo(e,w,w,i&&zs(qf(e,w,w,0,0,n,s,C,n,A=[],u,B),B),n,B,u,s,i?A:B):oo(E,w,w,w,[""],B,0,s,B)}}l=h=d=0,g=y=1,C=E="",u=o;break;case 58:u=1+ui(E),d=p;default:if(g<1){if(x==123)--g;else if(x==125&&g++==0&&k5()==125)continue}switch(E+=Ru(x),x*g){case 38:y=h>0?1:(E+="\f",-1);break;case 44:s[l++]=(ui(E)-1)*y,y=1;break;case 64:Fi()===45&&(E+=lc(ei())),f=Fi(),h=u=ui(C=E+=A5(so())),x++;break;case 45:p===45&&ui(E)==2&&(g=0)}}return a}function qf(e,t,r,i,n,a,o,s,c,l,h,u){for(var f=n-1,d=n===0?a:[""],p=v5(d),g=0,b=0,y=0;g<i;++g)for(var x=0,C=ia(e,f+1,f=$x(b=o[g])),A=e;x<p;++x)(A=Rx(b>0?d[x]+" "+C:ao(C,/&\f/g,d[x])))&&(c[y++]=A);return Ou(e,t,r,n===0?Lx:s,c,l,h,u)}function L5(e,t,r,i){return Ou(e,t,r,Mx,Ru(_5()),ia(e,2,-2),0,i)}function Hf(e,t,r,i,n){return Ou(e,t,r,Bx,ia(e,0,i),ia(e,i+1,-1),i,n)}function hh(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function B5(e,t,r,i){switch(e.type){case y5:if(e.children.length)break;case g5:case m5:case Bx:return e.return=e.return||e.value;case Mx:return"";case b5:return e.return=e.value+"{"+hh(e.children,i)+"}";case Lx:if(!ui(e.value=e.props.join(",")))return""}return ui(r=hh(e.children,i))?e.return=e.value+"{"+r+"}":""}var $5=sb(Object.keys,Object),R5=Object.prototype,O5=R5.hasOwnProperty;function N5(e){if(!bl(e))return $5(e);var t=[];for(var r in Object(e))O5.call(e,r)&&r!="constructor"&&t.push(r);return t}var uh=Sn(bi,"DataView"),dh=Sn(bi,"Promise"),fh=Sn(bi,"Set"),ph=Sn(bi,"WeakMap"),jf="[object Map]",I5="[object Object]",Uf="[object Promise]",Gf="[object Set]",Yf="[object WeakMap]",Vf="[object DataView]",D5=Cn(uh),F5=Cn(os),P5=Cn(dh),z5=Cn(fh),W5=Cn(ph),nn=la;(uh&&nn(new uh(new ArrayBuffer(1)))!=Vf||os&&nn(new os)!=jf||dh&&nn(dh.resolve())!=Uf||fh&&nn(new fh)!=Gf||ph&&nn(new ph)!=Yf)&&(nn=function(e){var t=la(e),r=t==I5?e.constructor:void 0,i=r?Cn(r):"";if(i)switch(i){case D5:return Vf;case F5:return jf;case P5:return Uf;case z5:return Gf;case W5:return Yf}return t});var q5="[object Map]",H5="[object Set]",j5=Object.prototype,U5=j5.hasOwnProperty;function Xf(e){if(e==null)return!0;if(yl(e)&&(zo(e)||typeof e=="string"||typeof e.splice=="function"||uu(e)||du(e)||Po(e)))return!e.length;var t=nn(e);if(t==q5||t==H5)return!e.size;if(bl(e))return!N5(e).length;for(var r in e)if(U5.call(e,r))return!1;return!0}var Nx="c4",G5=m(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Y5=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./wQVh1CoA.js");return{diagram:t}},__vite__mapDeps([8,9]),import.meta.url);return{id:Nx,diagram:e}},"loader"),V5={id:Nx,detector:G5,loader:Y5},X5=V5,Ix="flowchart",Z5=m((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"),K5=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./IPYC-LnN.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]),import.meta.url);return{id:Ix,diagram:e}},"loader"),Q5={id:Ix,detector:Z5,loader:K5},J5=Q5,Dx="flowchart-v2",tO=m((e,t)=>{var r,i,n;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)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),eO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./IPYC-LnN.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]),import.meta.url);return{id:Dx,diagram:e}},"loader"),rO={id:Dx,detector:tO,loader:eO},iO=rO,Fx="er",nO=m(e=>/^\s*erDiagram/.test(e),"detector"),aO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./8cZrfX0h.js");return{diagram:t}},__vite__mapDeps([15,12,13,14]),import.meta.url);return{id:Fx,diagram:e}},"loader"),sO={id:Fx,detector:nO,loader:aO},oO=sO,Px="gitGraph",lO=m(e=>/^\s*gitGraph/.test(e),"detector"),cO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./ulBFON_C.js");return{diagram:t}},__vite__mapDeps([16,17,18,19,20,21,4,2]),import.meta.url);return{id:Px,diagram:e}},"loader"),hO={id:Px,detector:lO,loader:cO},uO=hO,zx="gantt",dO=m(e=>/^\s*gantt/.test(e),"detector"),fO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./D9iCMida.js");return{diagram:t}},__vite__mapDeps([22,23,24,25]),import.meta.url);return{id:zx,diagram:e}},"loader"),pO={id:zx,detector:dO,loader:fO},gO=pO,Wx="info",mO=m(e=>/^\s*info/.test(e),"detector"),bO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./CRRR9MD_.js");return{diagram:t}},__vite__mapDeps([26,19,20,21,4,2]),import.meta.url);return{id:Wx,diagram:e}},"loader"),yO={id:Wx,detector:mO,loader:bO},qx="pie",xO=m(e=>/^\s*pie/.test(e),"detector"),vO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./Bpyvgze_.js");return{diagram:t}},__vite__mapDeps([27,17,19,20,21,4,2,28,29,24]),import.meta.url);return{id:qx,diagram:e}},"loader"),_O={id:qx,detector:xO,loader:vO},Hx="quadrantChart",kO=m(e=>/^\s*quadrantChart/.test(e),"detector"),wO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./CIctN7YN.js");return{diagram:t}},__vite__mapDeps([30,23,24,25]),import.meta.url);return{id:Hx,diagram:e}},"loader"),CO={id:Hx,detector:kO,loader:wO},SO=CO,jx="xychart",TO=m(e=>/^\s*xychart(-beta)?/.test(e),"detector"),EO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./9a6T2nm-.js");return{diagram:t}},__vite__mapDeps([31,24,29,23,25]),import.meta.url);return{id:jx,diagram:e}},"loader"),AO={id:jx,detector:TO,loader:EO},MO=AO,Ux="requirement",LO=m(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),BO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./Zxy7qc-l.js");return{diagram:t}},__vite__mapDeps([32,12,13]),import.meta.url);return{id:Ux,diagram:e}},"loader"),$O={id:Ux,detector:LO,loader:BO},RO=$O,Gx="sequence",OO=m(e=>/^\s*sequenceDiagram/.test(e),"detector"),NO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./CKrS_JZW.js");return{diagram:t}},__vite__mapDeps([33,9,18]),import.meta.url);return{id:Gx,diagram:e}},"loader"),IO={id:Gx,detector:OO,loader:NO},DO=IO,Yx="class",FO=m((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"),PO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./67pF3qNn.js");return{diagram:t}},__vite__mapDeps([34,35,11,12,13]),import.meta.url);return{id:Yx,diagram:e}},"loader"),zO={id:Yx,detector:FO,loader:PO},WO=zO,Vx="classDiagram",qO=m((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"),HO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./DngoTTgh.js");return{diagram:t}},__vite__mapDeps([36,35,11,12,13]),import.meta.url);return{id:Vx,diagram:e}},"loader"),jO={id:Vx,detector:qO,loader:HO},UO=jO,Xx="state",GO=m((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"),YO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./DsDh8EYs.js");return{diagram:t}},__vite__mapDeps([37,38,12,13,1,2,3,4]),import.meta.url);return{id:Xx,diagram:e}},"loader"),VO={id:Xx,detector:GO,loader:YO},XO=VO,Zx="stateDiagram",ZO=m((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"),KO=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./CSXtMOf0.js");return{diagram:t}},__vite__mapDeps([39,38,12,13]),import.meta.url);return{id:Zx,diagram:e}},"loader"),QO={id:Zx,detector:ZO,loader:KO},JO=QO,Kx="journey",tN=m(e=>/^\s*journey/.test(e),"detector"),eN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./DypDmXgd.js");return{diagram:t}},__vite__mapDeps([40,9,11,28]),import.meta.url);return{id:Kx,diagram:e}},"loader"),rN={id:Kx,detector:tN,loader:eN},iN=rN,nN=m((e,t,r)=>{rt.debug(`rendering svg for syntax error
|
|
321
|
+
`);const i=FA(t),n=i.append("g");i.attr("viewBox","0 0 2412 512"),xm(i,100,512,!0),n.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"),n.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"),n.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"),n.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"),n.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"),n.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"),n.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"),n.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"),Qx={draw:nN},aN=Qx,sN={db:{},renderer:Qx,parser:{parse:m(()=>{},"parse")}},oN=sN,Jx="flowchart-elk",lN=m((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"),cN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./IPYC-LnN.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]),import.meta.url);return{id:Jx,diagram:e}},"loader"),hN={id:Jx,detector:lN,loader:cN},uN=hN,tv="timeline",dN=m(e=>/^\s*timeline/.test(e),"detector"),fN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./C9I8FlXH.js");return{diagram:t}},__vite__mapDeps([41,28]),import.meta.url);return{id:tv,diagram:e}},"loader"),pN={id:tv,detector:dN,loader:fN},gN=pN,ev="mindmap",mN=m(e=>/^\s*mindmap/.test(e),"detector"),bN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./JpevfAFt.js");return{diagram:t}},__vite__mapDeps([42,12,13]),import.meta.url);return{id:ev,diagram:e}},"loader"),yN={id:ev,detector:mN,loader:bN},xN=yN,rv="kanban",vN=m(e=>/^\s*kanban/.test(e),"detector"),_N=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./CR6P9C4A.js");return{diagram:t}},__vite__mapDeps([43,11]),import.meta.url);return{id:rv,diagram:e}},"loader"),kN={id:rv,detector:vN,loader:_N},wN=kN,iv="sankey",CN=m(e=>/^\s*sankey(-beta)?/.test(e),"detector"),SN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./D9ykgMoY.js");return{diagram:t}},__vite__mapDeps([44,29,24]),import.meta.url);return{id:iv,diagram:e}},"loader"),TN={id:iv,detector:CN,loader:SN},EN=TN,nv="packet",AN=m(e=>/^\s*packet(-beta)?/.test(e),"detector"),MN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./1WZnGYqX.js");return{diagram:t}},__vite__mapDeps([45,17,19,20,21,4,2]),import.meta.url);return{id:nv,diagram:e}},"loader"),LN={id:nv,detector:AN,loader:MN},av="radar",BN=m(e=>/^\s*radar-beta/.test(e),"detector"),$N=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./BV6nKitt.js");return{diagram:t}},__vite__mapDeps([46,17,19,20,21,4,2]),import.meta.url);return{id:av,diagram:e}},"loader"),RN={id:av,detector:BN,loader:$N},sv="block",ON=m(e=>/^\s*block(-beta)?/.test(e),"detector"),NN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./DXlhR01x.js");return{diagram:t}},__vite__mapDeps([47,11,5,1,2,14]),import.meta.url);return{id:sv,diagram:e}},"loader"),IN={id:sv,detector:ON,loader:NN},DN=IN,ov="architecture",FN=m(e=>/^\s*architecture/.test(e),"detector"),PN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./CIQcWgO2.js");return{diagram:t}},__vite__mapDeps([48,17,19,20,21,4,2,7]),import.meta.url);return{id:ov,diagram:e}},"loader"),zN={id:ov,detector:FN,loader:PN},WN=zN,lv="treemap",qN=m(e=>/^\s*treemap/.test(e),"detector"),HN=m(async()=>{const{diagram:e}=await Ne(async()=>{const{diagram:t}=await import("./JTLiF7dt.js");return{diagram:t}},__vite__mapDeps([49,13,17,19,20,21,4,2,25,29,24]),import.meta.url);return{id:lv,diagram:e}},"loader"),jN={id:lv,detector:qN,loader:HN},Zf=!1,Ml=m(()=>{Zf||(Zf=!0,Lo("error",oN,e=>e.toLowerCase().trim()==="error"),Lo("---",{db:{clear:m(()=>{},"clear")},styles:{},renderer:{draw:m(()=>{},"draw")},parser:{parse:m(()=>{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:m(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Lc(uN,xN,WN),Lc(X5,wN,UO,WO,oO,gO,yO,_O,RO,DO,iO,J5,gN,uO,JO,XO,iN,SO,EN,LN,MO,DN,RN,jN))},"addDiagrams"),UN=m(async()=>{rt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(mn).map(async([r,{detector:i,loader:n}])=>{if(n)try{Oc(r)}catch{try{const{diagram:a,id:o}=await n();Lo(o,a,i)}catch(a){throw rt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete mn[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){rt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)rt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),GN="graphics-document document";function cv(e,t){e.attr("role",GN),t!==""&&e.attr("aria-roledescription",t)}m(cv,"setA11yDiagramInfo");function hv(e,t,r,i){if(e.insert!==void 0){if(r){const n=`chart-desc-${i}`;e.attr("aria-describedby",n),e.insert("desc",":first-child").attr("id",n).text(r)}if(t){const n=`chart-title-${i}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}m(hv,"addSVGa11yTitleDescription");var fn,gh=(fn=class{constructor(t,r,i,n,a){this.type=t,this.text=r,this.db=i,this.parser=n,this.renderer=a}static async fromText(t,r={}){var l,h;const i=gr(),n=Vh(t,i);t=j3(t)+`
|
|
322
|
+
`;try{Oc(n)}catch{const u=jE(n);if(!u)throw new om(`Diagram ${n} not found.`);const{id:f,diagram:d}=await u();Lo(f,d)}const{db:a,parser:o,renderer:s,init:c}=Oc(n);return o.parser&&(o.parser.yy=a),(l=a.clear)==null||l.call(a),c==null||c(i),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await o.parse(t),new fn(n,t,a,o,s)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},m(fn,"Diagram"),fn),Kf=[],YN=m(()=>{Kf.forEach(e=>{e()}),Kf=[]},"attachFunctions"),VN=m(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function uv(e){const t=e.match(sm);if(!t)return{text:e,metadata:{}};let r=UM(t[1],{schema:jM})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}m(uv,"extractFrontMatter");var XN=m(e=>e.replace(/\r\n?/g,`
|
|
323
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),ZN=m(e=>{const{text:t,metadata:r}=uv(e),{displayMode:i,title:n,config:a={}}=r;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:n,config:a,text:t}},"processFrontmatter"),KN=m(e=>{const t=Jr.detectInit(e)??{},r=Jr.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:B3(e),directive:t}},"processDirectives");function Nu(e){const t=XN(e),r=ZN(t),i=KN(r.text),n=yu(r.config,i.directive);return e=VN(i.text),{code:e,title:r.title,config:n}}m(Nu,"preprocessDiagram");function dv(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}m(dv,"toBase64");var QN=5e4,JN="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",tI="sandbox",eI="loose",rI="http://www.w3.org/2000/svg",iI="http://www.w3.org/1999/xlink",nI="http://www.w3.org/1999/xhtml",aI="100%",sI="100%",oI="border:0;margin:0;",lI="margin:0",cI="allow-top-navigation-by-user-activation allow-popups",hI='The "iframe" tag is not supported by your browser.',uI=["foreignobject"],dI=["dominant-baseline"];function Iu(e){const t=Nu(e);return Ao(),sA(t.config??{}),t}m(Iu,"processAndSetConfigs");async function fv(e,t){Ml();try{const{code:r,config:i}=Iu(e);return{diagramType:(await gv(r)).type,config:i}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}m(fv,"parse");var Qf=m((e,t,r=[])=>`
|
|
324
|
+
.${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),fI=m((e,t=new Map)=>{var i;let r="";if(e.themeCSS!==void 0&&(r+=`
|
|
325
|
+
${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
|
|
326
|
+
:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
|
|
327
|
+
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const s=e.htmlLabels??((i=e.flowchart)==null?void 0:i.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(c=>{Xf(c.styles)||s.forEach(l=>{r+=Qf(c.id,l,c.styles)}),Xf(c.textStyles)||(r+=Qf(c.id,"tspan",((c==null?void 0:c.textStyles)||[]).map(l=>l.replace("color","fill"))))})}return r},"createCssStyles"),pI=m((e,t,r,i)=>{const n=fI(e,r),a=TA(t,n,e.themeVariables);return hh(M5(`${i}{${a}}`),B5)},"createUserStyles"),gI=m((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Tn(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),mI=m((e="",t)=>{var n,a;const r=(a=(n=t==null?void 0:t.viewBox)==null?void 0:n.baseVal)!=null&&a.height?t.viewBox.baseVal.height+"px":sI,i=dv(`<body style="${lI}">${e}</body>`);return`<iframe style="width:${aI};height:${r};${oI}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${cI}">
|
|
328
|
+
${hI}
|
|
329
|
+
</iframe>`},"putIntoIFrame"),Jf=m((e,t,r,i,n)=>{const a=e.append("div");a.attr("id",r),i&&a.attr("style",i);const o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",rI);return n&&o.attr("xmlns:xlink",n),o.append("g"),e},"appendDivSvgG");function mh(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}m(mh,"sandboxedIframe");var bI=m((e,t,r,i)=>{var n,a,o;(n=e.getElementById(t))==null||n.remove(),(a=e.getElementById(r))==null||a.remove(),(o=e.getElementById(i))==null||o.remove()},"removeExistingElements"),yI=m(async function(e,t,r){var z,D,_,T,k,S;Ml();const i=Iu(t);t=i.code;const n=gr();rt.debug(n),t.length>((n==null?void 0:n.maxTextSize)??QN)&&(t=JN);const a="#"+e,o="i"+e,s="#"+o,c="d"+e,l="#"+c,h=m(()=>{const W=se(f?s:l).node();W&&"remove"in W&&W.remove()},"removeTempElements");let u=se("body");const f=n.securityLevel===tI,d=n.securityLevel===eI,p=n.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const M=mh(se(r),o);u=se(M.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=se(r);Jf(u,e,c,`font-family: ${p}`,iI)}else{if(bI(document,e,c,o),f){const M=mh(se("body"),o);u=se(M.nodes()[0].contentDocument.body),u.node().style.margin=0}else u=se("body");Jf(u,e,c)}let g,b;try{g=await gh.fromText(t,{title:i.title})}catch(M){if(n.suppressErrorRendering)throw h(),M;g=await gh.fromText("error"),b=M}const y=u.select(l).node(),x=g.type,C=y.firstChild,A=C.firstChild,B=(D=(z=g.renderer).getClasses)==null?void 0:D.call(z,t,g),w=pI(n,x,B,a),E=document.createElement("style");E.innerHTML=w,C.insertBefore(E,A);try{await g.renderer.draw(t,e,Pd.version,g)}catch(M){throw n.suppressErrorRendering?h():aN.draw(t,e,Pd.version),M}const I=u.select(`${l} svg`),Y=(T=(_=g.db).getAccTitle)==null?void 0:T.call(_),q=(S=(k=g.db).getAccDescription)==null?void 0:S.call(k);mv(x,I,Y,q),u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",nI);let F=u.select(l).node().innerHTML;if(rt.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),F=gI(F,f,nr(n.arrowMarkerAbsolute)),f){const M=u.select(l+" svg").node();F=mI(F,M)}else d||(F=Qn.sanitize(F,{ADD_TAGS:uI,ADD_ATTR:dI,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(YN(),b)throw b;return h(),{diagramType:x,svg:F,bindFunctions:g.db.bindFunctions}},"render");function pv(e={}){var i;const t=er({},e);t!=null&&t.fontFamily&&!((i=t.themeVariables)!=null&&i.fontFamily)&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),nA(t),t!=null&&t.theme&&t.theme in Ei?t.themeVariables=Ei[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Ei.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?iA(t):dm();Yh(r.logLevel),Ml()}m(pv,"initialize");var gv=m((e,t={})=>{const{code:r}=Nu(e);return gh.fromText(r,t)},"getDiagramFromText");function mv(e,t,r,i){cv(t,e),hv(t,r,i,t.attr("id"))}m(mv,"addA11yInfo");var _n=Object.freeze({render:yI,parse:fv,getDiagramFromText:gv,initialize:pv,getConfig:gr,setConfig:fm,getSiteConfig:dm,updateSiteConfig:aA,reset:m(()=>{Ao()},"reset"),globalReset:m(()=>{Ao(Jn)},"globalReset"),defaultConfig:Jn});Yh(gr().logLevel);Ao(gr());var xI=m((e,t,r)=>{rt.warn(e),bu(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),bv=m(async function(e={querySelector:".mermaid"}){try{await vI(e)}catch(t){if(bu(t)&&rt.error(t.str),Or.parseError&&Or.parseError(t),!e.suppressErrors)throw rt.error("Use the suppressErrors option to suppress these errors"),t}},"run"),vI=m(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=_n.getConfig();rt.debug(`${e?"":"No "}Callback function found`);let n;if(r)n=r;else if(t)n=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");rt.debug(`Found ${n.length} diagrams`),(i==null?void 0:i.startOnLoad)!==void 0&&(rt.debug("Start On Load: "+(i==null?void 0:i.startOnLoad)),_n.updateSiteConfig({startOnLoad:i==null?void 0:i.startOnLoad}));const a=new Jr.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let o;const s=[];for(const c of Array.from(n)){if(rt.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const l=`mermaid-${a.next()}`;o=c.innerHTML,o=Fb(Jr.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=Jr.detectInit(o);h&&rt.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:f}=await _v(l,o,c);c.innerHTML=u,e&&await e(l),f&&f(c)}catch(u){xI(u,s,Or.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),yv=m(function(e){_n.initialize(e)},"initialize"),_I=m(async function(e,t,r){rt.warn("mermaid.init is deprecated. Please use run instead."),e&&yv(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await bv(i)},"init"),kI=m(async(e,{lazyLoad:t=!0}={})=>{Ml(),Lc(...e),t===!1&&await UN()},"registerExternalDiagrams"),xv=m(function(){if(Or.startOnLoad){const{startOnLoad:e}=_n.getConfig();e&&Or.run().catch(t=>rt.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",xv,!1);var wI=m(function(e){Or.parseError=e},"setParseErrorHandler"),Ko=[],cc=!1,vv=m(async()=>{if(!cc){for(cc=!0;Ko.length>0;){const e=Ko.shift();if(e)try{await e()}catch(t){rt.error("Error executing queue",t)}}cc=!1}},"executeQueue"),CI=m(async(e,t)=>new Promise((r,i)=>{const n=m(()=>new Promise((a,o)=>{_n.parse(e,t).then(s=>{a(s),r(s)},s=>{var c;rt.error("Error parsing",s),(c=Or.parseError)==null||c.call(Or,s),o(s),i(s)})}),"performCall");Ko.push(n),vv().catch(i)}),"parse"),_v=m((e,t,r)=>new Promise((i,n)=>{const a=m(()=>new Promise((o,s)=>{_n.render(e,t,r).then(c=>{o(c),i(c)},c=>{var l;rt.error("Error parsing",c),(l=Or.parseError)==null||l.call(Or,c),s(c),n(c)})}),"performCall");Ko.push(a),vv().catch(n)}),"render"),SI=m(()=>Object.keys(mn).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Or={startOnLoad:!0,mermaidAPI:_n,parse:CI,render:_v,init:_I,run:bv,registerExternalDiagrams:kI,registerLayoutLoaders:Ax,initialize:yv,parseError:void 0,contentLoaded:xv,setParseErrorHandler:wI,detectType:Vh,registerIconPacks:V$,getRegisteredDiagramsMetadata:SI},tp=Or;/*! Check if previously processed *//*!
|
|
330
|
+
* Wait for document loaded before starting the execution
|
|
331
|
+
*/var TI=it('<div class="markdown-viewer svelte-1i59led"><!></div>');function EI(e,t){Ir(t,!0);let r=ae(""),i;$e.setOptions({gfm:!0,breaks:!0,headerIds:!0,mangle:!1});function n(){const c=In.current==="dark";tp.initialize({startOnLoad:!1,theme:c?"dark":"default",securityLevel:"loose",fontFamily:"SF Pro, system-ui, -apple-system, sans-serif"})}tl(()=>{n()}),ir(()=>{In.current&&(n(),t.content&&a())}),ir(()=>{t.content&&a()});async function a(){try{const c=await $e.parse(t.content);et(r,c,!0),setTimeout(async()=>{if(i){const l=i.querySelectorAll("code.language-mermaid");for(let h=0;h<l.length;h++){const u=l[h],f=u.textContent||"";try{const d=`mermaid-${Date.now()}-${h}`,{svg:p}=await tp.render(d,f),g=u.parentElement;if(g&&g.tagName==="PRE"){const b=document.createElement("div");b.className="mermaid-diagram",b.innerHTML=p,g.replaceWith(b)}}catch(d){console.error("Failed to render mermaid diagram:",d)}}}},0)}catch(c){console.error("Failed to render markdown:",c),et(r,`<div class="error">Failed to render markdown: ${c}</div>`)}}var o=TI(),s=$(o);kh(s,()=>v(r)),L(o),Xa(o,c=>i=c,()=>i),xt(()=>Ue(o,"data-theme",In.current)),Z(e,o),Dr()}var AI=it('<div class="loading-state svelte-1y85kzg"><div class="spinner svelte-1y85kzg"></div> <p>Loading content...</p></div>'),MI=it('<div class="no-content svelte-1y85kzg"><p>File is empty or not loaded</p></div>'),LI=it("<option>Uncommitted changes</option>"),BI=it("<option> </option>"),$I=it('<div class="commit-selector svelte-1y85kzg"><label for="commit-select" class="svelte-1y85kzg">View changes from:</label> <select id="commit-select" class="svelte-1y85kzg"><!><!></select></div>'),RI=it('<div class="loading-state svelte-1y85kzg"><div class="spinner svelte-1y85kzg"></div> <p>Loading git diff...</p></div>'),OI=it('<div class="no-content svelte-1y85kzg"><p>No uncommitted changes detected</p></div>'),NI=it('<div class="no-content svelte-1y85kzg"><p>No changes in selected commit</p></div>'),II=it('<pre class="diff-content svelte-1y85kzg"><!></pre>'),DI=it('<div class="diff-container svelte-1y85kzg"><!> <!></div>'),FI=it('<div class="image-container svelte-1y85kzg"><img class="image-preview svelte-1y85kzg"/></div>'),PI=it('<pre class="plaintext svelte-1y85kzg"> </pre>'),zI=it('<div class="code-container svelte-1y85kzg"><!></div>'),WI=it('<div class="file-viewer svelte-1y85kzg"><div class="viewer-header svelte-1y85kzg"><div class="file-info svelte-1y85kzg"><div class="flex items-center gap-2"><h3 class="file-path svelte-1y85kzg"> </h3> <!></div> <p class="file-meta svelte-1y85kzg"> </p></div> <div class="view-toggle svelte-1y85kzg"><button>Content</button> <button>Changes</button></div></div> <div class="viewer-content svelte-1y85kzg"><!></div></div>'),qI=it('<div class="file-viewer empty svelte-1y85kzg"><div class="empty-message svelte-1y85kzg"><p>Select a file to view its contents</p></div></div>');function HI(e,t){Ir(t,!0);let r=We(t,"isLoading",3,!1),i=ae(!1),n=ae(""),a=ae(""),o=ae("");tl(async()=>{try{const k=await(await fetch("/api/working-directory")).json();k.working_directory&&et(o,k.working_directory,!0)}catch(T){console.error("[FileViewer] Failed to fetch working directory:",T)}});let s=ae("content"),c=ae(""),l=ae(!1),h=ae(!1),u=ae(!1),f=ae(Bi([])),d=ae(!1),p=ae("");ir(()=>{v(s)==="changes"&&!v(p)&&(v(d)||v(f).length>0)&&(v(d)?et(p,""):v(f).length>0&&et(p,v(f)[0].full_hash,!0))}),ir(()=>{t.file&&v(s)==="changes"&&g(v(p))});async function g(T=""){if(t.file){et(u,!0);try{const k=T?`/api/file/diff?path=${encodeURIComponent(t.file.path)}&commit=${encodeURIComponent(T)}`:`/api/file/diff?path=${encodeURIComponent(t.file.path)}`,M=await(await fetch(k)).json();M.success?(et(c,M.diff||"",!0),et(l,M.has_changes||!1,!0),et(h,M.tracked!==!1),et(f,M.history||[],!0),et(d,M.has_uncommitted||!1,!0)):(et(c,""),et(l,!1),et(h,!1),et(f,[],!0),et(d,!1))}catch(k){console.error("Failed to fetch git diff:",k),et(c,""),et(l,!1),et(h,!1),et(f,[],!0),et(d,!1)}finally{et(u,!1)}}}function b(T){et(p,T,!0),g(T)}ir(()=>{t.file&&y()});async function y(){if(t.file){console.log("[FileViewer] Checking git status for:",t.file.path),console.log("[FileViewer] File object:",t.file);try{const T=`/api/file/diff?path=${encodeURIComponent(t.file.path)}`;console.log("[FileViewer] Fetching from URL:",T);const k=await fetch(T);console.log("[FileViewer] Response status:",k.status);const S=await k.json();console.log("[FileViewer] Git status response:",JSON.stringify(S,null,2)),S.success?(et(l,S.has_changes||!1,!0),et(h,S.tracked!==!1),et(f,S.history||[],!0),et(d,S.has_uncommitted||!1,!0),et(p,""),console.log("[FileViewer] Git status updated:",{hasGitChanges:v(l),isGitTracked:v(h),showToggle:v(h)&&(v(d)||v(f).length>0),tracked_value:S.tracked,has_changes_value:S.has_changes,history_count:v(f).length,has_uncommitted:v(d)})):(console.log("[FileViewer] Git status check failed:",S.error),et(l,!1),et(h,!1),et(f,[],!0),et(d,!1))}catch(T){console.error("[FileViewer] Failed to check git status:",T),et(l,!1),et(h,!1),et(f,[],!0),et(d,!1)}}}let x=we(()=>v(h)&&(v(d)||v(f).length>0));function C(T){return T.split(`
|
|
332
|
+
`).map(S=>S.startsWith("@@")?`<span class="diff-hunk">${A(S)}</span>`:S.startsWith("+++")||S.startsWith("---")?`<span class="diff-file">${A(S)}</span>`:S.startsWith("+")?`<span class="diff-add">${A(S)}</span>`:S.startsWith("-")?`<span class="diff-remove">${A(S)}</span>`:S.startsWith("diff --git")?`<span class="diff-header">${A(S)}</span>`:S.startsWith("index ")?`<span class="diff-index">${A(S)}</span>`:`<span class="diff-context">${A(S)}</span>`).join(`
|
|
333
|
+
`)}function A(T){const k=document.createElement("div");return k.textContent=T,k.innerHTML}const B={py:oT,ts:Td,tsx:Td,js:Ed,jsx:Ed,md:Ad,markdown:Ad,json:dT,html:Md,xml:Md,css:fT,scss:$d,sass:$d,sh:Ld,bash:Ld,yaml:Bd,yml:Bd,sql:TT};function w(T){var S;const k=((S=T.split(".").pop())==null?void 0:S.toLowerCase())||"";return B[k]||null}function E(T){if(T===0)return"0 B";const k=T/1024;return k<1024?`${k.toFixed(1)} KB`:`${(k/1024).toFixed(1)} MB`}function I(T){if(!v(o)||!T.startsWith(v(o)))return T;const k=T.substring(v(o).length);return k.startsWith("/")?k:"/"+k}function Y(T){var S;const k=((S=T.split(".").pop())==null?void 0:S.toLowerCase())||"";return["png","jpg","jpeg","gif","svg","webp","ico","bmp"].includes(k)}function q(T){var S;const k=((S=T.split(".").pop())==null?void 0:S.toLowerCase())||"";return["md","markdown"].includes(k)}ir(()=>{var T;if(t.file&&Y(t.file.name)&&t.content){et(i,!0);const k=((T=t.file.name.split(".").pop())==null?void 0:T.toLowerCase())||"png";et(n,{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp",ico:"image/x-icon",bmp:"image/bmp"}[k]||"image/png",!0),et(a,t.content,!0)}else et(i,!1),et(n,""),et(a,"")});var F=Ge(),z=Ee(F);{var D=T=>{var k=WI(),S=$(k),M=$(S),W=$(M),N=$(W),O=$(N,!0);L(N);var j=H(N,2);Ar(j,{get text(){return t.file.path},size:"sm"}),L(W);var G=H(W,2),X=$(G);L(G),L(M);var J=H(M,2),K=$(J);let at;K.__click=()=>et(s,"content");var lt=H(K,2);let wt;lt.__click=()=>{v(x)&&et(s,"changes")},L(J),L(S);var _t=H(S,2),ot=$(_t);{var Ct=Ht=>{var gt=AI();Z(Ht,gt)},zt=Ht=>{var gt=Ge(),Mt=Ee(gt);{var kt=Tt=>{var Et=MI();Z(Tt,Et)},St=Tt=>{var Et=Ge(),ht=Ee(Et);{var Lt=oe=>{var me=DI(),ee=$(me);{var yt=re=>{var be=$I(),ue=H($(be),2);ue.__change=()=>b(v(p));var Ft=$(ue);{var te=Qt=>{var Zt=LI();Zt.value=Zt.__value="",Z(Qt,Zt)};mt(Ft,Qt=>{v(d)&&Qt(te)})}var pe=H(Ft);hr(pe,17,()=>v(f),di,(Qt,Zt)=>{var Yt=BI(),he=$(Yt);L(Yt);var ge={};xt(()=>{tt(he,`${v(Zt).hash??""} - ${v(Zt).message??""} (${v(Zt).time_ago??""})`),ge!==(ge=v(Zt).full_hash)&&(Yt.value=(Yt.__value=v(Zt).full_hash)??"")}),Z(Qt,Yt)}),L(ue),L(be),Za(ue,()=>v(p),Qt=>et(p,Qt)),Z(re,be)};mt(ee,re=>{(v(f).length>0||v(d))&&re(yt)})}var Gt=H(ee,2);{var Kt=re=>{var be=RI();Z(re,be)},Nt=re=>{var be=Ge(),ue=Ee(be);{var Ft=pe=>{var Qt=OI();Z(pe,Qt)},te=pe=>{var Qt=Ge(),Zt=Ee(Qt);{var Yt=ge=>{var Ie=NI();Z(ge,Ie)},he=ge=>{var Ie=II(),Me=$(Ie);kh(Me,()=>C(v(c))),L(Ie),Z(ge,Ie)};mt(Zt,ge=>{v(c)?ge(he,!1):ge(Yt)},!0)}Z(pe,Qt)};mt(ue,pe=>{!v(l)&&!v(p)?pe(Ft):pe(te,!1)},!0)}Z(re,be)};mt(Gt,re=>{v(u)?re(Kt):re(Nt,!1)})}L(me),Z(oe,me)},fe=oe=>{var me=Ge(),ee=Ee(me);{var yt=Kt=>{var Nt=FI(),re=$(Nt);L(Nt),xt(()=>{Ue(re,"src",`data:${v(n)??""};base64,${v(a)??""}`),Ue(re,"alt",t.file.name)}),Z(Kt,Nt)},Gt=Kt=>{var Nt=Ge(),re=Ee(Nt);{var be=Ft=>{EI(Ft,{get content(){return t.content}})},ue=Ft=>{var te=zI(),pe=$(te);{var Qt=Yt=>{aT(Yt,{get code(){return t.content}})},Zt=Yt=>{const he=we(()=>w(t.file.name));var ge=Ge(),Ie=Ee(ge);{var Me=V=>{GS(V,{get language(){return v(he)},get code(){return t.content}})},R=V=>{var Q=PI(),pt=$(Q,!0);L(Q),xt(()=>tt(pt,t.content)),Z(V,Q)};mt(Ie,V=>{v(he)?V(Me):V(R,!1)})}Z(Yt,ge)};mt(pe,Yt=>{t.file.name.endsWith(".svelte")?Yt(Qt):Yt(Zt,!1)})}L(te),xt(()=>Ue(te,"data-theme",In.current)),Z(Ft,te)};mt(re,Ft=>{t.file&&q(t.file.name)?Ft(be):Ft(ue,!1)},!0)}Z(Kt,Nt)};mt(ee,Kt=>{v(i)?Kt(yt):Kt(Gt,!1)},!0)}Z(oe,me)};mt(ht,oe=>{v(s)==="changes"?oe(Lt):oe(fe,!1)},!0)}Z(Tt,Et)};mt(Mt,Tt=>{!t.content&&v(s)==="content"?Tt(kt):Tt(St,!1)},!0)}Z(Ht,gt)};mt(ot,Ht=>{r()?Ht(Ct):Ht(zt,!1)})}L(_t),L(k),xt((Ht,gt,Mt)=>{tt(O,Ht),tt(X,`${gt??""}
|
|
334
|
+
· Last modified ${Mt??""}`),at=Ae(K,1,"toggle-btn svelte-1y85kzg",null,at,{active:v(s)==="content"}),wt=Ae(lt,1,"toggle-btn svelte-1y85kzg",null,wt,{active:v(s)==="changes",disabled:!v(x)}),lt.disabled=!v(x),Ue(lt,"title",v(x)?"View git changes":"No git changes detected")},[()=>I(t.file.path),()=>E(t.file.size),()=>new Date(t.file.modified*1e3).toLocaleString()]),Z(T,k)},_=T=>{var k=qI();Z(T,k)};mt(z,T=>{t.file?T(D):T(_,!1)})}Z(e,F),Dr()}Ur(["click","change"]);function jI(e){const t=new Map;for(const r of e){if(!r.data||typeof r.data!="object")continue;const n=r.data.correlation_id;if(n){if(r.event==="pre-tool")if(!t.has(n))t.set(n,{pre:r});else{const a=t.get(n);t.set(n,{...a,pre:r})}else if(r.event==="post-tool")if(!t.has(n))t.set(n,{pre:{...r,event:"pre-tool"},post:r});else{const a=t.get(n);t.set(n,{...a,post:r})}}}return t}function UI(e){return!e.data||typeof e.data!="object"?"Unknown":e.data.tool_name||"Unknown"}function ep(e){return!e.data||typeof e.data!="object"?void 0:e.data.correlation_id}function GI(e){return Jo(e,r=>{const i=r,n=new Map,a=i.filter(s=>{const c=s.data,l=c&&typeof c=="object"&&!Array.isArray(c)?c.subtype:void 0,h=s.subtype||l;return h==="pre_tool"||h==="post_tool"});return jI(a.map(s=>({event:s.subtype==="pre_tool"?"pre-tool":"post-tool",timestamp:s.timestamp,session_id:s.session_id,data:s.data}))).forEach((s,c)=>{const l=a.find(y=>y.subtype==="pre_tool"&&ep({timestamp:y.timestamp,session_id:y.session_id,data:y.data})===c),h=a.find(y=>y.subtype==="post_tool"&&ep({timestamp:y.timestamp,session_id:y.session_id,data:y.data})===c);if(!l)return;const u=l.data,f=u&&typeof u=="object"&&!Array.isArray(u)?u:null,d=UI({timestamp:l.timestamp,session_id:l.session_id,data:l.data}),p=YI(d,f);let g="pending",b=null;if(h){const y=h.data,x=y&&typeof y=="object"&&!Array.isArray(y)?y:null;g=(x==null?void 0:x.error)||(x==null?void 0:x.is_error)?"error":"success";const A=typeof l.timestamp=="string"?new Date(l.timestamp).getTime():l.timestamp;b=(typeof h.timestamp=="string"?new Date(h.timestamp).getTime():h.timestamp)-A}n.set(c,{id:c,toolName:d,operation:p,status:g,duration:b,preToolEvent:l,postToolEvent:h||null,timestamp:l.timestamp})}),Array.from(n.values()).sort((s,c)=>{const l=typeof s.timestamp=="string"?new Date(s.timestamp).getTime():s.timestamp;return(typeof c.timestamp=="string"?new Date(c.timestamp).getTime():c.timestamp)-l})})}function YI(e,t){if(!t)return"No details";const r=t.tool_parameters&&typeof t.tool_parameters=="object"&&!Array.isArray(t.tool_parameters)?t.tool_parameters:null;switch(e){case"Bash":const i=t.description||(r==null?void 0:r.description),n=t.command||(r==null?void 0:r.command),a=t.operation_type;return i?oi(i,40):n?oi(n,40):a||"No command";case"Read":const o=t.file_path||(r==null?void 0:r.file_path);return o?`Read ${oi(o,35)}`:"Read file";case"Edit":const s=t.file_path||(r==null?void 0:r.file_path);return s?`Edit ${oi(s,35)}`:"Edit file";case"Write":const c=t.file_path||(r==null?void 0:r.file_path);return c?`Write ${oi(c,35)}`:"Write file";case"Grep":const l=t.pattern||(r==null?void 0:r.pattern);return l?`Search: ${oi(l,30)}`:"Search";case"Glob":const h=t.pattern||(r==null?void 0:r.pattern);return h?`Find: ${oi(h,30)}`:"Find files";default:return t.description||r!=null&&r.description?oi(t.description||(r==null?void 0:r.description),40):t.action||r!=null&&r.action?oi(t.action||(r==null?void 0:r.action),40):t.query||r!=null&&r.query?oi(t.query||(r==null?void 0:r.query),40):"Tool execution"}}function oi(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}function Aa(e){var t,r;return e.session_id||e.sessionId||((t=e.data)==null?void 0:t.session_id)||((r=e.data)==null?void 0:r.sessionId)||e.source||null}function bh(e){if(typeof e.data!="object"||!e.data)return null;const t=e.data;if(t.agent_type&&typeof t.agent_type=="string")return t.agent_type;const r=t.delegation_details;if(r&&typeof r=="object"){const n=r;if(n.agent_type&&typeof n.agent_type=="string")return n.agent_type}const i=t.tool_parameters;if(i&&typeof i=="object"){const n=i;if(n.agent&&typeof n.agent=="string")return n.agent}return null}function VI(e){var i;if(e.subtype!=="pre_tool"||typeof e.data!="object"||!e.data)return!1;const t=e.data;return(t.tool_name||((i=t.tool_parameters)==null?void 0:i.tool_name))==="Task"}function rp(e){var i;if(e.subtype!=="pre_tool"||typeof e.data!="object"||!e.data)return!1;const t=e.data;return(t.tool_name||((i=t.tool_parameters)==null?void 0:i.tool_name))==="TodoWrite"}function XI(e){var i;if(e.subtype!=="pre_tool"||typeof e.data!="object"||!e.data)return!1;const t=e.data;return(t.tool_name||((i=t.tool_parameters)==null?void 0:i.tool_name))==="EnterPlanMode"}function ZI(e){var i;if(e.subtype!=="pre_tool"||typeof e.data!="object"||!e.data)return!1;const t=e.data;return(t.tool_name||((i=t.tool_parameters)==null?void 0:i.tool_name))==="ExitPlanMode"}function KI(e){var a;if(e.subtype!=="pre_tool"||typeof e.data!="object"||!e.data)return!1;const t=e.data;if((t.tool_name||((a=t.tool_parameters)==null?void 0:a.tool_name))!=="Write")return!1;const i=t.tool_parameters,n=t.file_path||(i==null?void 0:i.file_path);return n&&(n.toLowerCase().includes("plan")||n.toLowerCase().includes("work-plan")||n.toLowerCase().includes("task-plan"))}function QI(e){if(typeof e.data!="object"||!e.data)return null;const t=e.data,r=t.tool_parameters,i=(r==null?void 0:r.content)||t.content,n=t.file_path||(r==null?void 0:r.file_path);return i?{content:i,filePath:n}:null}function ip(e){if(typeof e.data!="object"||!e.data)return[];const r=e.data.tool_parameters;if(!r||typeof r!="object")return[];const n=r.todos;return Array.isArray(n)?n.map(a=>({content:a.content||"",status:a.status||"pending",activeForm:a.activeForm||void 0})):[]}function hc(e){return typeof e.data!="object"||!e.data?null:e.data.correlation_id||null}function yh(e){var r;if(typeof e.data!="object"||!e.data)return"Unknown";const t=e.data;return t.tool_name||((r=t.tool_parameters)==null?void 0:r.tool_name)||"Unknown"}function np(e){const t=yh(e);if(typeof e.data!="object"||!e.data)return"No details";const r=e.data,i=r.tool_parameters;switch(t){case"Bash":const n=r.description||(i==null?void 0:i.description);return n?n.slice(0,50):"Execute command";case"Read":const a=r.file_path||(i==null?void 0:i.file_path);return a?`Read ${a.split("/").pop()}`:"Read file";case"Edit":const o=r.file_path||(i==null?void 0:i.file_path);return o?`Edit ${o.split("/").pop()}`:"Edit file";case"Write":const s=r.file_path||(i==null?void 0:i.file_path);return s?`Write ${s.split("/").pop()}`:"Write file";case"TodoWrite":return"Update todos";case"Task":const c=bh(e);return c?`Delegate to ${c}`:"Delegate task";default:return`${t} execution`}}function ap(e){const t=new Map;return e.forEach(r=>{let i="";if(r.toolName==="Read"||r.toolName==="Edit"||r.toolName==="Write"){const a=r.operation.match(/(?:Read|Edit|Write)\s+(.+)/);i=a?a[1]:r.operation}else r.toolName==="Bash"?i=r.operation.slice(0,30):i=r.operation;const n=`${r.toolName}:${i}`;if(t.has(n)){const a=t.get(n);a.count++,a.instances.push(r),r.timestamp>a.latestTimestamp&&(a.latestTimestamp=r.timestamp),(r.status==="error"||a.status==="pending"&&r.status!=="success")&&(a.status=r.status)}else t.set(n,{toolName:r.toolName,target:i,count:1,latestTimestamp:r.timestamp,status:r.status,instances:[r]})}),Array.from(t.values()).sort((r,i)=>i.latestTimestamp-r.latestTimestamp)}function JI(e){return Jo(e,t=>{const r=t,i=new Map,n=new Map,a=new Map,o=new Map,s={id:"pm",name:"PM",depth:0,sessionId:"pm",status:"active",startTime:Date.now(),endTime:null,parentId:null,children:[],toolCalls:[],groupedToolCalls:[],todos:[],plans:[],responses:[]};i.set("pm",s),r.forEach(u=>{const f=Aa(u);if(u.subtype==="subagent_start"){const d=bh(u)||"Agent",p=typeof u.timestamp=="string"?new Date(u.timestamp).getTime():u.timestamp;if(console.log("[AgentsStore] subagent_start detected:",{sessionId:f,agentType:d,timestamp:new Date(p).toLocaleTimeString(),hasSessionId:!!f}),!f){console.warn("[AgentsStore] subagent_start missing session_id:",u);return}i.has(f)?console.warn("[AgentsStore] Duplicate session_id detected:",f,"agent_type:",d):i.set(f,{id:f,name:d,depth:1,sessionId:f,status:"active",startTime:p,endTime:null,parentId:null,children:[],toolCalls:[],groupedToolCalls:[],todos:[],plans:[],responses:[]})}else if(u.subtype==="subagent_stop"){const d=i.get(f);if(d){const p=typeof u.timestamp=="string"?new Date(u.timestamp).getTime():u.timestamp;if(d.endTime=p,typeof u.data=="object"&&u.data){const g=u.data;g.error||g.is_error?d.status="error":d.status="completed"}else d.status="completed"}}VI(u)&&bh(u)&&u.correlation_id}),r.forEach(u=>{const f=Aa(u);if(!f)return;const d=typeof u.timestamp=="string"?new Date(u.timestamp).getTime():u.timestamp;if(u.subtype==="pre_tool"){const p=hc(u);if(!p)return;const g=yh(u),b=np(u),y={id:p,toolName:g,operation:b,status:"pending",timestamp:d,duration:null};if(n.has(f)||n.set(f,[]),n.get(f).push(y),rp(u)){const x=ip(u),C={id:p,timestamp:d,todos:x};a.has(f)||a.set(f,[]),a.get(f).push(C)}if(XI(u)){const x={timestamp:d,content:"Agent entered plan mode",status:"draft",mode:"entered"};o.has(f)||o.set(f,[]),o.get(f).push(x)}if(ZI(u)){const x={timestamp:d,content:"Agent exited plan mode",status:"completed",mode:"exited"};o.has(f)||o.set(f,[]),o.get(f).push(x)}if(KI(u)){const x=QI(u);if(x){const C={timestamp:d,content:x.content,planFile:x.filePath,status:"draft"};o.has(f)||o.set(f,[]),o.get(f).push(C)}}}if(u.subtype==="post_tool"){const p=hc(u);if(!p)return;const g=n.get(f);if(g){const b=g.find(y=>y.id===p);if(b)if(b.duration=d-b.timestamp,typeof u.data=="object"&&u.data){const y=u.data;b.status=y.error||y.is_error?"error":"success"}else b.status="success"}}if((u.subtype==="todo_updated"||u.type==="todo_updated")&&typeof u.data=="object"&&u.data){const g=u.data.todos;if(Array.isArray(g)&&g.length>0){const b={id:`todo-${d}-${f}`,timestamp:d,todos:g.map(y=>({content:y.content||"",status:y.status||"pending",activeForm:y.activeForm||void 0}))};a.has(f)||a.set(f,[]),a.get(f).push(b),console.log("[AgentsStore] Captured todo_updated event:",{sessionId:f.slice(0,12),todoCount:g.length,timestamp:new Date(d).toLocaleTimeString()})}}}),r.forEach(u=>{const f=Aa(u),d=typeof u.timestamp=="string"?new Date(u.timestamp).getTime():u.timestamp;if(u.subtype==="user_prompt"||u.type==="user_prompt"){const g=u.data.prompt_text;g&&s&&(s.userPrompt=g)}if(u.subtype==="pre_tool"){const p=u.data;if(p.tool_name==="Task"){const b=p.delegation_details;if(b&&f){const y=b.prompt,x=b.description,C=b.agent_type;r.forEach(A=>{const B=Aa(A);if(A.subtype==="subagent_start"&&B&&A.data.agent_type===C){const I=i.get(B);I&&y&&(I.delegationPrompt=y,I.delegationDescription=x)}})}}}if(u.subtype==="subagent_stop"||u.type==="subagent_stop"){const g=u.data.output;if(g&&f){const b=i.get(f);b&&b.responses.push({timestamp:d,content:g,type:"text"})}}if(u.type==="assistant_message"||u.subtype==="assistant_message"){const g=u.data.content;if(g&&f){const b=i.get(f)||s;b&&b.responses.push({timestamp:d,content:g,type:"text"})}}}),i.forEach((u,f)=>{u.toolCalls=n.get(f)||[],u.groupedToolCalls=ap(u.toolCalls),u.todos=a.get(f)||[],u.plans=o.get(f)||[]});const c=i.get("pm");i.forEach((u,f)=>{f!=="pm"&&(u.parentId="pm",c.children.push(u))}),console.log("[AgentsStore] Final agent tree:",{totalAgents:i.size,pmChildren:c.children.length,agents:Array.from(i.values()).map(u=>({name:u.name,sessionId:u.sessionId.slice(0,12),status:u.status,startTime:new Date(u.startTime).toLocaleTimeString()}))});const l=[],h=[];return r.forEach(u=>{const f=Aa(u);if(!f||f==="pm"){const d=typeof u.timestamp=="string"?new Date(u.timestamp).getTime():u.timestamp;if(u.subtype==="pre_tool"){const p=hc(u);if(!p)return;const g=yh(u),b=np(u);l.push({id:p,toolName:g,operation:b,status:"pending",timestamp:d,duration:null}),rp(u)&&h.push({id:p,timestamp:d,todos:ip(u)})}}}),c.toolCalls=[...l,...c.toolCalls],c.groupedToolCalls=ap(c.toolCalls),c.todos=[...h,...c.todos],c})}var tD=it('<div class="flex items-center justify-center h-full text-slate-500 dark:text-slate-400"><p>Loading agent data...</p></div>'),eD=it('<div class="flex items-center justify-center h-full text-slate-500 dark:text-slate-400"><div class="text-center"><svg class="w-16 h-16 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg> <p class="text-lg">Select a file to view its content</p></div></div>'),rD=it('<div class="flex flex-col h-screen bg-slate-50 dark:bg-slate-900 transition-colors"><!> <div class="split-container flex flex-1 min-h-0"><div class="left-panel flex flex-col flex-shrink-0 min-w-0"><div class="bg-slate-100 dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 transition-colors"><div class="flex gap-0 px-2 pt-2"><button>Events</button> <button>Tools</button> <button>Files</button> <button>Agents</button></div></div> <div class="flex-1 min-h-0"><!></div></div> <div role="separator" aria-label="Resize panels" tabindex="0"></div> <div class="right-panel flex flex-col flex-1 min-w-0 min-h-0"><!></div></div></div>');function HD(e,t){Ir(t,!0);const r=()=>tn(p,"$selectedStream",i),[i,n]=vp();let a=ae(null),o=ae(null),s=ae(null),c=ae(null),l=ae(""),h=ae(!1),u=ae("events"),f=ae(40),d=ae(!1);const{selectedStream:p,events:g,currentWorkingDirectory:b,projectFilter:y}=Xn,x=Jo([g,p,b,y],([gt,Mt,kt,St])=>Mt==="all-streams"?St==="current"&&kt?gt.filter(Tt=>{var ht,Lt,fe,oe;return(Tt.cwd||Tt.working_directory||((ht=Tt.data)==null?void 0:ht.working_directory)||((Lt=Tt.data)==null?void 0:Lt.cwd)||((fe=Tt.metadata)==null?void 0:fe.working_directory)||((oe=Tt.metadata)==null?void 0:oe.cwd))===kt}):gt:Mt===""?gt:gt.filter(Tt=>{var ht,Lt;return(Tt.session_id||Tt.sessionId||((ht=Tt.data)==null?void 0:ht.session_id)||((Lt=Tt.data)==null?void 0:Lt.sessionId)||Tt.source||null)===Mt})),C=GI(x),A=JI(x);let B=ae(Bi([]));ir(()=>C.subscribe(Mt=>{et(B,Mt,!0)}));let w=ae(null);ir(()=>A.subscribe(Mt=>{et(w,Mt,!0)})),ir(()=>{v(u)==="events"?(et(o,null),et(s,null),et(c,null)):v(u)==="tools"?(et(a,null),et(s,null),et(c,null)):v(u)==="files"?(et(a,null),et(o,null),et(c,null)):v(u)==="agents"&&(et(a,null),et(o,null),et(s,null))}),ir(()=>{r(),et(a,null),et(o,null),et(s,null),et(c,null),et(l,"")});function E(gt){et(d,!0),gt.preventDefault()}function I(gt){if(!v(d))return;const Mt=document.querySelector(".split-container");if(!Mt)return;const kt=Mt.getBoundingClientRect(),St=(gt.clientX-kt.left)/kt.width*100,Tt=300/kt.width*100,ht=100-200/kt.width*100;et(f,Math.max(Tt,Math.min(ht,St)),!0)}function Y(){et(d,!1)}function q(gt){console.log("[AgentToolClick] Clicked tool:",gt),console.log("[AgentToolClick] Available tools count:",v(B).length),console.log("[AgentToolClick] Looking for correlation ID:",gt.id);const Mt=v(B).find(kt=>kt.id===gt.id);Mt?(console.log("[AgentToolClick] Found matching tool:",Mt),et(u,"tools"),et(o,Mt,!0)):(console.warn("[AgentToolClick] Tool not found for correlation ID:",gt.id),console.warn("[AgentToolClick] Available tool IDs:",v(B).map(kt=>kt.id)))}var F=rD();x_("1uha8ag",gt=>{Qo(()=>{c_.title="Claude MPM Monitor"})}),Yu("mousemove",Gu,I),Yu("mouseup",Gu,Y);var z=$(F);$_(z,{});var D=H(z,2),_=$(D),T=$(_),k=$(T),S=$(k);S.__click=()=>et(u,"events");let M;var W=H(S,2);W.__click=()=>et(u,"tools");let N;var O=H(W,2);O.__click=()=>et(u,"files");let j;var G=H(O,2);G.__click=()=>et(u,"agents");let X;L(k),L(T);var J=H(T,2),K=$(J);{var at=gt=>{P_(gt,{get selectedStream(){return r()},get selectedEvent(){return v(a)},set selectedEvent(Mt){et(a,Mt,!0)}})},lt=gt=>{var Mt=Ge(),kt=Ee(Mt);{var St=Et=>{U_(Et,{get tools(){return v(B)},get selectedStream(){return r()},get selectedTool(){return v(o)},set selectedTool(ht){et(o,ht,!0)}})},Tt=Et=>{var ht=Ge(),Lt=Ee(ht);{var fe=me=>{var ee=Ge(),yt=Ee(ee);{var Gt=Nt=>{XC(Nt,{get rootAgent(){return v(w)},get selectedStream(){return r()},get selectedAgent(){return v(c)},set selectedAgent(re){et(c,re,!0)}})},Kt=Nt=>{var re=tD();Z(Nt,re)};mt(yt,Nt=>{v(w)?Nt(Gt):Nt(Kt,!1)})}Z(me,ee)},oe=me=>{var ee=Ge(),yt=Ee(ee);{var Gt=Kt=>{IC(Kt,{get selectedStream(){return r()},get selectedFile(){return v(s)},set selectedFile(Nt){et(s,Nt,!0)},get fileContent(){return v(l)},set fileContent(Nt){et(l,Nt,!0)},get contentLoading(){return v(h)},set contentLoading(Nt){et(h,Nt,!0)}})};mt(yt,Kt=>{v(u)==="files"&&Kt(Gt)},!0)}Z(me,ee)};mt(Lt,me=>{v(u)==="agents"?me(fe):me(oe,!1)},!0)}Z(Et,ht)};mt(kt,Et=>{v(u)==="tools"?Et(St):Et(Tt,!1)},!0)}Z(gt,Mt)};mt(K,gt=>{v(u)==="events"?gt(at):gt(lt,!1)})}L(J),L(_);var wt=H(_,2);let _t;wt.__mousedown=E;var ot=H(wt,2),Ct=$(ot);{var zt=gt=>{var Mt=Ge(),kt=Ee(Mt);{var St=Et=>{{let ht=we(()=>({name:v(s).name,path:v(s).path,type:"file",size:v(l).length,modified:typeof v(s).timestamp=="string"?new Date(v(s).timestamp).getTime()/1e3:v(s).timestamp/1e3}));HI(Et,{get file(){return v(ht)},get content(){return v(l)},get isLoading(){return v(h)}})}},Tt=Et=>{var ht=eD();Z(Et,ht)};mt(kt,Et=>{v(s)?Et(St):Et(Tt,!1)})}Z(gt,Mt)},Ht=gt=>{var Mt=Ge(),kt=Ee(Mt);{var St=Et=>{kS(Et,{get agent(){return v(c)},onToolClick:q})},Tt=Et=>{qS(Et,{get event(){return v(a)},get tool(){return v(o)}})};mt(kt,Et=>{v(u)==="agents"?Et(St):Et(Tt,!1)},!0)}Z(gt,Mt)};mt(Ct,gt=>{v(u)==="files"?gt(zt):gt(Ht,!1)})}L(ot),L(D),L(F),xt(()=>{Di(_,`width: ${v(f)??""}%;`),M=Ae(S,1,"tab svelte-1uha8ag",null,M,{active:v(u)==="events"}),N=Ae(W,1,"tab svelte-1uha8ag",null,N,{active:v(u)==="tools"}),j=Ae(O,1,"tab svelte-1uha8ag",null,j,{active:v(u)==="files"}),X=Ae(G,1,"tab svelte-1uha8ag",null,X,{active:v(u)==="agents"}),_t=Ae(wt,1,"divider svelte-1uha8ag",null,_t,{dragging:v(d)}),Di(ot,`width: ${100-v(f)}%;`)}),Z(e,F),Dr(),n()}Ur(["click","mousedown"]);export{vm as $,Ha as A,pE as B,NA as C,yu as D,gr as E,um as F,I3 as G,FA as H,Pd as I,jM as J,ZE as K,ta as L,ED as M,xl as N,gA as O,Xh as P,Kd as Q,G2 as R,Zs as S,N3 as T,gs as U,wA as V,ps as W,Bt as X,Ut as Y,E3 as Z,m as _,MA as a,mf as a$,rg as a0,yd as a1,bd as a2,yD as a3,fD as a4,mD as a5,gD as a6,uD as a7,Ii as a8,$h as a9,Z$ as aA,U2 as aB,TD as aC,yl as aD,zo as aE,mb as aF,Eg as aG,vs as aH,V$ as aI,Y$ as aJ,Bh as aK,Ot as aL,rb as aM,Eh as aN,Ni as aO,hd as aP,Xk as aQ,Ja as aR,e3 as aS,pb as aT,ob as aU,aB as aV,Do as aW,sB as aX,ys as aY,nn as aZ,ZB as a_,bD as aa,dD as ab,vD as ac,xD as ad,pD as ae,_R as af,Cx as ag,PD as ah,GM as ai,nr as aj,Ui as ak,lu as al,Zb as am,Tn as an,kb as ao,ne as ap,pi as aq,d5 as ar,FD as as,zD as at,ID as au,It as av,DD as aw,VR as ax,HR as ay,qR as az,AA as b,wn as b0,oB as b1,uu as b2,nB as b3,hB as b4,ca as b5,t3 as b6,w3 as b7,gB as b8,m3 as b9,cb as bA,fh as bB,HD as bC,cu as ba,Xf as bb,Br as bc,qk as bd,Th as be,qp as bf,ds as bg,Up as bh,hD as bi,fE as bj,k3 as bk,g3 as bl,C3 as bm,pl as bn,rB as bo,hu as bp,fb as bq,T3 as br,la as bs,o3 as bt,N5 as bu,bs as bv,Po as bw,ji as bx,uf as by,du as bz,Re as c,se as d,xm as e,er as f,BA as g,Li as h,Hr as i,QM as j,sa as k,rt as l,Cb as m,AD as n,qD as o,$A as p,RA as q,WD as r,LA as s,UM as t,Jr as u,PR as v,P3 as w,LD as x,EA as y,MD as z};
|