diff --git a/package.json b/package.json index 91e13091..ed7a24b8 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,14 @@ "check:templates": "node scripts/check-vue-templates.mjs", "check:template-bindings": "node scripts/check-template-bindings.mjs", "check:modal-race": "node scripts/check-modal-race.mjs", - "check": "npm run check:templates && npm run check:template-bindings && npm run check:modal-race && npm run check:host-access-races && npm run check:socket-identity && npm run check:schedule-time && npm run check:config-health && npm run check:config-center-ui2 && npm run check:config-save-boundaries && npm run build", + "check": "npm run check:templates && npm run check:template-bindings && npm run check:modal-race && npm run check:host-access-races && npm run check:socket-identity && npm run check:schedule-time && npm run check:schedule-report-format && npm run check:config-health && npm run check:config-center-ui2 && npm run check:config-save-boundaries && npm run build", "check:host-access-races": "node scripts/check-host-access-races.mjs", "check:socket-identity": "node scripts/check-socket-identity.mjs", "check:schedule-time": "node scripts/check-schedule-time.mjs", "check:config-health": "node scripts/check-config-health.mjs", "check:config-center-ui2": "node scripts/check-config-center-ui2.mjs", - "check:config-save-boundaries": "node scripts/check-config-save-boundaries.mjs" + "check:config-save-boundaries": "node scripts/check-config-save-boundaries.mjs", + "check:schedule-report-format": "node scripts/check-schedule-report-format.mjs" }, "dependencies": { "dompurify": "^3.2.0", diff --git a/scripts/check-schedule-report-format.mjs b/scripts/check-schedule-report-format.mjs new file mode 100644 index 00000000..ed3746c0 --- /dev/null +++ b/scripts/check-schedule-report-format.mjs @@ -0,0 +1,19 @@ +import fs from 'node:fs'; +import process from 'node:process'; + +const source = fs.readFileSync(new URL('../ui/js/pages/schedules.js', import.meta.url), 'utf8'); +const assertions = [ + ['format selector exists', source.includes('v-model="form.report_format"')], + ['generic v1 option exists', source.includes('value="paginated_embed_v1"')], + ['form state owns field', source.includes("report_format: ''")], + ['create payload submits field', source.includes('payload.report_format = f.report_format')], + ['list readback renders field', source.includes("s.report_format || ''")], + ['update surface submits field', source.includes('report_format: reportFormat')], + ['update surface refreshes authoritative state', source.includes('await fetchSchedules()')], +]; +const failures = assertions.filter(([, passed]) => !passed); +for (const [name, passed] of assertions) { + console.log(`${passed ? 'ok' : 'not ok'} - ${name}`); +} +if (failures.length) process.exit(1); +console.log(`schedule-report-format: ${assertions.length} assertions passed`); diff --git a/src/discord/client.py b/src/discord/client.py index 74132c21..1d46d899 100644 --- a/src/discord/client.py +++ b/src/discord/client.py @@ -151,6 +151,8 @@ def __init__(self, config: Config) -> None: self.tool_loop = components.tool_loop self.turn_recorder = components.turn_recorder self.scheduled_events = components.scheduled_events + self.scheduled_report_renderers = components.scheduled_report_renderers + self.scheduled_reports = components.scheduled_reports self.agent_task_tools = components.agent_task_tools self.intake = components.intake self.pipeline = components.pipeline diff --git a/src/discord/cogs/reaction_triggers.py b/src/discord/cogs/reaction_triggers.py index 052f72a6..ea289dba 100644 --- a/src/discord/cogs/reaction_triggers.py +++ b/src/discord/cogs/reaction_triggers.py @@ -14,7 +14,7 @@ from __future__ import annotations import logging -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, cast from discord.ext import commands @@ -22,6 +22,7 @@ if TYPE_CHECKING: from src.config.schema import ReactionTriggerConfig + from src.discord.scheduled_report import ScheduledReportPaginationService from src.scheduler.scheduler import Scheduler logger = logging.getLogger("odin.reaction_triggers") @@ -36,10 +37,12 @@ def __init__( *, config: ReactionTriggerConfig | None = None, scheduler: Scheduler | None = None, + pagination: ScheduledReportPaginationService | None = None, ) -> None: self.bot = bot self._config = config self._scheduler = scheduler + self._pagination = pagination @property def enabled(self) -> bool: @@ -82,11 +85,19 @@ def _is_user_allowed(self, user_id: int) -> bool: @commands.Cog.listener() async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) -> None: """Handle a reaction being added to a message.""" - if not self.enabled: + # Ignore the bot's own control reactions before either subsystem. + if self.bot.user and payload.user_id == self.bot.user.id: + return + + # Pagination is message-local and independent of the optional generic + # reaction-trigger feature and its channel/user allowlists. + if self._pagination and self._pagination.handles( + payload.message_id, payload.emoji + ): + await self._pagination.handle_reaction(payload) return - # Ignore bot's own reactions - if payload.user_id == self.bot.user.id: # type: ignore[union-attr] # raw events fire post-READY + if not self.enabled: return # Check channel allowlist @@ -133,4 +144,5 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) -> async def setup(bot: commands.Bot) -> None: """Standard discord.py cog setup (no-op scheduler/config — wired later).""" - await bot.add_cog(ReactionTriggers(bot)) + components = cast(Any, bot).components + await bot.add_cog(ReactionTriggers(bot, pagination=components.scheduled_reports)) diff --git a/src/discord/native_tools/scheduling.py b/src/discord/native_tools/scheduling.py index c0ed16e5..7819e517 100644 --- a/src/discord/native_tools/scheduling.py +++ b/src/discord/native_tools/scheduling.py @@ -114,6 +114,7 @@ async def _handle_schedule_task(self, message, inp: dict) -> str: trigger=inp.get("trigger"), cron_timezone=inp.get("cron_timezone"), requester_id=str(message.author.id), + report_format=inp.get("report_format"), ) if schedule.get("trigger"): trigger_desc = ", ".join(f"{k}={v}" for k, v in schedule["trigger"].items()) @@ -171,6 +172,7 @@ async def _handle_update_schedule(self, inp: dict) -> str: "steps", "channel_id", "cron_timezone", + "report_format", ): if key in inp: kwargs[key] = inp[key] diff --git a/src/discord/scheduled_events.py b/src/discord/scheduled_events.py index eefa1369..86d79e4b 100644 --- a/src/discord/scheduled_events.py +++ b/src/discord/scheduled_events.py @@ -31,6 +31,7 @@ from ..tools.executor import ToolExecutor from .llm_gateway import LLMGateway from .native_tools.agents_tasks import AgentTaskTools + from .scheduled_report import ScheduledReportPaginationService from .tool_loop import ToolLoopRunner log = get_logger("discord") @@ -48,6 +49,7 @@ class ScheduledEventsDeps: llm_gateway: LLMGateway # owns the swappable provider clients tool_loop: ToolLoopRunner # shared dispatch path agent_task_tools: AgentTaskTools # agent result collection in workflows + scheduled_reports: ScheduledReportPaginationService | None = None class ScheduledEventHandlers: @@ -60,6 +62,7 @@ def __init__(self, deps: ScheduledEventsDeps) -> None: self._llm_gateway = deps.llm_gateway self._tool_loop = deps.tool_loop self._agent_task_tools = deps.agent_task_tools + self._scheduled_reports = deps.scheduled_reports async def _on_scheduled_digest(self, schedule: dict) -> None: """Run the daily infrastructure digest and post results.""" @@ -415,10 +418,32 @@ async def _on_scheduled_task(self, schedule: dict) -> None: pass raise RuntimeError(f"Scheduled check failed: {str(result)[:200]}") else: - text = ( - f"**Scheduled: {schedule['description']}**\n```\n{str(result)[:1800]}\n```" - ) - await channel.send(scrub_response_secrets(text)) + report_format = schedule.get("report_format") + if report_format: + if self._scheduled_reports is None: + raise RuntimeError("Scheduled report service is unavailable") + try: + # The pagination service parses JSON first and scrubs + # only validated strings that can reach Discord. + await self._scheduled_reports.post(channel, report_format, str(result)) + except Exception as e: + text = ( + f"**Scheduled report failed:** {schedule['description']}\n" + f"Error: {e}" + ) + try: + await channel.send(scrub_response_secrets(text)) + except Exception: + pass + raise RuntimeError( + f"Failed to render scheduled report {report_format}: {e}" + ) from e + else: + text = ( + f"**Scheduled: {schedule['description']}**\n```\n" + f"{str(result)[:1800]}\n```" + ) + await channel.send(scrub_response_secrets(text)) except RuntimeError: raise except Exception as e: diff --git a/src/discord/scheduled_report.py b/src/discord/scheduled_report.py new file mode 100644 index 00000000..b6215ae6 --- /dev/null +++ b/src/discord/scheduled_report.py @@ -0,0 +1,588 @@ +"""Generic structured Discord reports for scheduled checks. + +A scheduled check owns command execution. A registered renderer owns validation +and presentation. :class:`ScheduledReportPaginationService` owns only durable, +message-local pagination state and redraws; reaction refresh never executes the +producer again. +""" + +from __future__ import annotations + +import asyncio +import json +import os +import re +from collections.abc import Callable, Mapping +from datetime import UTC, datetime +from pathlib import Path +from typing import Any, Protocol +from urllib.parse import quote, urlsplit + +import discord + +from ..odin_log import get_logger +from .response_guards import scrub_response_secrets + +log = get_logger("discord") + +PAGINATED_EMBED_V1 = "paginated_embed_v1" +REPORT_REACTIONS = ("⬅️", "➡️", "🔄") +LEFT_REACTIONS = frozenset({"⬅", "⬅️", "◀", "◀️"}) +RIGHT_REACTIONS = frozenset({"➡", "➡️", "▶", "▶️"}) +REFRESH_REACTIONS = frozenset({"🔄"}) +CONTROL_REACTIONS = LEFT_REACTIONS | RIGHT_REACTIONS | REFRESH_REACTIONS + +MAX_PAGES = 10 +MAX_FIELDS_PER_PAGE = 25 +MAX_TITLE_CHARS = 256 +MAX_DESCRIPTION_CHARS = 4096 +MAX_FIELD_NAME_CHARS = 256 +MAX_FIELD_VALUE_CHARS = 1024 +MAX_FOOTER_INPUT_CHARS = 1984 +MAX_FOOTER_CHARS = 2048 +MAX_LINKS = 10 +MAX_LINK_LABEL_CHARS = 100 +MAX_LINK_URL_CHARS = 512 +MAX_EMBED_CHARS = 6000 +MAX_REPORT_AGE_SECONDS = 26 * 60 * 60 + +_PAGE_KEYS = frozenset({"title", "description", "fields", "footer", "links"}) +_FIELD_KEYS = frozenset({"name", "value", "inline"}) +_LINK_KEYS = frozenset({"label", "url"}) +_ROOT_KEYS = frozenset({"format", "pages"}) +_EMPTY_PROJECTION = { + "format": PAGINATED_EMBED_V1, + "pages": [ + { + "title": "Scheduled report", + "description": "No report data.", + "fields": [], + "footer": "", + "links": [], + } + ], +} + + +class ScheduledReportRenderer(Protocol): + """A versioned renderer that returns a persistence-safe projection.""" + + format_name: str + + def project(self, payload: Any) -> dict[str, Any]: ... + + def render_page(self, projection: Mapping[str, Any], page: int) -> discord.Embed: ... + + def validate_projection(self, projection: Any) -> dict[str, Any]: ... + + +class ScheduledReportRendererRegistry: + """Format-to-renderer dispatch with no schedule-domain knowledge.""" + + def __init__(self) -> None: + self._renderers: dict[str, ScheduledReportRenderer] = {} + + def register(self, renderer: ScheduledReportRenderer) -> None: + name = renderer.format_name + if not name or name in self._renderers: + raise ValueError(f"Scheduled report renderer already registered: {name!r}") + self._renderers[name] = renderer + + @property + def formats(self) -> tuple[str, ...]: + return tuple(self._renderers) + + def renderer(self, report_format: str) -> ScheduledReportRenderer: + try: + return self._renderers[report_format] + except KeyError as exc: + raise ValueError(f"Unsupported scheduled report format: {report_format}") from exc + + def project(self, report_format: str, raw_output: str) -> dict[str, Any]: + """Parse producer JSON before any string-level secret scrubbing.""" + try: + payload = json.loads(raw_output) + except json.JSONDecodeError as exc: + raise ValueError(f"Scheduled report did not return valid JSON: {exc.msg}") from exc + return self.renderer(report_format).project(payload) + + def validate_projection(self, report_format: str, projection: Any) -> dict[str, Any]: + return self.renderer(report_format).validate_projection(projection) + + def render_page( + self, report_format: str, projection: Mapping[str, Any], page: int + ) -> discord.Embed: + return self.renderer(report_format).render_page(projection, page) + + +def _reject_extra_keys(value: Mapping[str, Any], allowed: frozenset[str], context: str) -> None: + extras = set(value) - allowed + if extras: + raise ValueError(f"{context} contains unknown keys: {', '.join(sorted(extras))}") + + +def _rendered_text( + value: Any, + *, + context: str, + limit: int, + required: bool = False, +) -> str: + if not isinstance(value, str): + raise ValueError(f"{context} must be a string") + rendered = value.strip() + if required and not rendered: + raise ValueError(f"{context} must be a non-empty string") + # Scrub only the individual strings that can reach Discord. JSON structure + # has already been parsed, so redaction cannot damage syntax or types. + rendered = scrub_response_secrets(rendered) + if any((ord(char) < 32 and char not in {"\n", "\t"}) or ord(char) == 127 for char in rendered): + raise ValueError(f"{context} contains control characters") + rendered = discord.utils.escape_mentions(rendered) + rendered = discord.utils.escape_markdown(rendered) + # Discord Markdown still recognizes URL syntax after escape_markdown; + # neutralize delimiters so only the structured links array can create + # clickable links. + rendered = re.sub(r"(?])", r"\\\1", rendered) + if len(rendered) > limit: + raise ValueError(f"{context} exceeds {limit} characters after rendering") + if required and not rendered: + raise ValueError(f"{context} is empty after rendering") + return rendered + + +def _safe_link_url(value: Any, *, context: str, scrub: bool = True) -> str: + if not isinstance(value, str): + raise ValueError(f"{context} must be a string") + url = value.strip() + if scrub: + url = scrub_response_secrets(url) + if not url or len(url) > MAX_LINK_URL_CHARS: + raise ValueError(f"{context} must contain 1-{MAX_LINK_URL_CHARS} characters") + if any(char.isspace() or ord(char) < 32 or ord(char) == 127 for char in url): + raise ValueError(f"{context} contains whitespace or control characters") + try: + parsed = urlsplit(url) + port = parsed.port + except ValueError as exc: + raise ValueError(f"{context} is not a valid URL") from exc + if parsed.scheme not in {"http", "https"} or not parsed.hostname: + raise ValueError(f"{context} must be an absolute HTTP(S) URL") + if parsed.username is not None or parsed.password is not None: + raise ValueError(f"{context} must not contain credentials") + if port is not None and not 1 <= port <= 65535: + raise ValueError(f"{context} has an invalid port") + # Parentheses and angle brackets can break Discord's Markdown link target. + # Keep RFC 3986 delimiters and percent-encode presentation delimiters. + return quote(url, safe=":/?#[]@!$&'*+,;=%-._~") + + +def _embed_text_count(page: Mapping[str, Any], footer: str) -> int: + total = len(page["title"]) + len(page["description"]) + len(footer) + total += sum(len(field["name"]) + len(field["value"]) for field in page["fields"]) + if page["links"]: + links_value = "\n".join(f"[{link['label']}]({link['url']})" for link in page["links"]) + total += len("Links") + len(links_value) + return total + + +def _footer_text(page: Mapping[str, Any], page_number: int, page_count: int) -> str: + navigation = f"Page {page_number + 1}/{page_count} · ← → navigate · ↻ redraw" + footer = page["footer"] + rendered = f"{footer} · {navigation}" if footer else navigation + if len(rendered) > MAX_FOOTER_CHARS: + raise ValueError(f"rendered footer exceeds {MAX_FOOTER_CHARS} characters") + return rendered + + +class PaginatedEmbedV1Renderer: + """Validate and render the public ``paginated_embed_v1`` contract.""" + + format_name = PAGINATED_EMBED_V1 + + def project(self, payload: Any) -> dict[str, Any]: + if not isinstance(payload, dict): + raise ValueError("Scheduled report JSON must be an object") + _reject_extra_keys(payload, _ROOT_KEYS, "report") + if payload.get("format") != self.format_name: + raise ValueError(f"report.format must be {self.format_name!r}") + pages = payload.get("pages") + if not isinstance(pages, list): + raise ValueError("report.pages must be an array") + if len(pages) > MAX_PAGES: + raise ValueError(f"report.pages exceeds the {MAX_PAGES}-page limit") + if not pages: + return json.loads(json.dumps(_EMPTY_PROJECTION)) + + projected_pages = [self._project_page(page, index) for index, page in enumerate(pages)] + projection = {"format": self.format_name, "pages": projected_pages} + return self.validate_projection(projection) + + def _project_page(self, page: Any, index: int) -> dict[str, Any]: + context = f"report.pages[{index}]" + if not isinstance(page, dict): + raise ValueError(f"{context} must be an object") + _reject_extra_keys(page, _PAGE_KEYS, context) + if "title" not in page: + raise ValueError(f"{context}.title is required") + title = _rendered_text( + page["title"], + context=f"{context}.title", + limit=MAX_TITLE_CHARS, + required=True, + ) + description = _rendered_text( + page.get("description", ""), + context=f"{context}.description", + limit=MAX_DESCRIPTION_CHARS, + ) + footer = _rendered_text( + page.get("footer", ""), + context=f"{context}.footer", + limit=MAX_FOOTER_INPUT_CHARS, + ) + + fields_raw = page.get("fields", []) + if not isinstance(fields_raw, list): + raise ValueError(f"{context}.fields must be an array") + fields: list[dict[str, Any]] = [] + for field_index, field in enumerate(fields_raw): + field_context = f"{context}.fields[{field_index}]" + if not isinstance(field, dict): + raise ValueError(f"{field_context} must be an object") + _reject_extra_keys(field, _FIELD_KEYS, field_context) + if "name" not in field or "value" not in field: + raise ValueError(f"{field_context} requires name and value") + inline = field.get("inline", False) + if not isinstance(inline, bool): + raise ValueError(f"{field_context}.inline must be a boolean") + fields.append( + { + "name": _rendered_text( + field["name"], + context=f"{field_context}.name", + limit=MAX_FIELD_NAME_CHARS, + required=True, + ), + "value": _rendered_text( + field["value"], + context=f"{field_context}.value", + limit=MAX_FIELD_VALUE_CHARS, + required=True, + ), + "inline": inline, + } + ) + + links_raw = page.get("links", []) + if not isinstance(links_raw, list): + raise ValueError(f"{context}.links must be an array") + if len(links_raw) > MAX_LINKS: + raise ValueError(f"{context}.links exceeds the {MAX_LINKS}-link limit") + links: list[dict[str, str]] = [] + for link_index, link in enumerate(links_raw): + link_context = f"{context}.links[{link_index}]" + if not isinstance(link, dict): + raise ValueError(f"{link_context} must be an object") + _reject_extra_keys(link, _LINK_KEYS, link_context) + if "label" not in link or "url" not in link: + raise ValueError(f"{link_context} requires label and url") + links.append( + { + "label": _rendered_text( + link["label"], + context=f"{link_context}.label", + limit=MAX_LINK_LABEL_CHARS, + required=True, + ), + "url": _safe_link_url(link["url"], context=f"{link_context}.url"), + } + ) + + if len(fields) + bool(links) > MAX_FIELDS_PER_PAGE: + raise ValueError( + f"{context} exceeds {MAX_FIELDS_PER_PAGE} rendered fields; links use one field" + ) + return { + "title": title, + "description": description, + "fields": fields, + "footer": footer, + "links": links, + } + + def validate_projection(self, projection: Any) -> dict[str, Any]: + """Validate persisted normalized data without escaping it a second time.""" + if not isinstance(projection, dict) or set(projection) != _ROOT_KEYS: + raise ValueError("persisted report projection has an invalid root shape") + if projection.get("format") != self.format_name: + raise ValueError("persisted report projection has the wrong format") + pages = projection.get("pages") + if not isinstance(pages, list) or not 1 <= len(pages) <= MAX_PAGES: + raise ValueError("persisted report projection has an invalid page count") + for index, page in enumerate(pages): + context = f"projection.pages[{index}]" + if not isinstance(page, dict) or set(page) != _PAGE_KEYS: + raise ValueError(f"{context} has an invalid shape") + for key, limit, required in ( + ("title", MAX_TITLE_CHARS, True), + ("description", MAX_DESCRIPTION_CHARS, False), + ("footer", MAX_FOOTER_INPUT_CHARS, False), + ): + value = page[key] + if not isinstance(value, str) or len(value) > limit or (required and not value): + raise ValueError(f"{context}.{key} is invalid") + fields = page["fields"] + links = page["links"] + if not isinstance(fields, list) or not isinstance(links, list): + raise ValueError(f"{context} fields and links must be arrays") + if len(fields) + bool(links) > MAX_FIELDS_PER_PAGE or len(links) > MAX_LINKS: + raise ValueError(f"{context} exceeds field or link limits") + for field in fields: + if not isinstance(field, dict) or set(field) != {"name", "value", "inline"}: + raise ValueError(f"{context} contains an invalid field") + if ( + not isinstance(field["name"], str) + or not field["name"] + or len(field["name"]) > MAX_FIELD_NAME_CHARS + or not isinstance(field["value"], str) + or not field["value"] + or len(field["value"]) > MAX_FIELD_VALUE_CHARS + or not isinstance(field["inline"], bool) + ): + raise ValueError(f"{context} contains an invalid field value") + for link in links: + if not isinstance(link, dict) or set(link) != {"label", "url"}: + raise ValueError(f"{context} contains an invalid link") + if ( + not isinstance(link["label"], str) + or not link["label"] + or len(link["label"]) > MAX_LINK_LABEL_CHARS + or not isinstance(link["url"], str) + or len(link["url"]) > MAX_LINK_URL_CHARS + ): + raise ValueError(f"{context} contains an invalid link value") + if ( + _safe_link_url(link["url"], context=f"{context}.link.url", scrub=False) + != link["url"] + ): + raise ValueError(f"{context} contains a non-normalized link URL") + links_value = "\n".join(f"[{link['label']}]({link['url']})" for link in links) + if len(links_value) > MAX_FIELD_VALUE_CHARS: + raise ValueError(f"{context}.links exceeds the rendered field-value limit") + footer = _footer_text(page, index, len(pages)) + if _embed_text_count(page, footer) > MAX_EMBED_CHARS: + raise ValueError(f"{context} exceeds the {MAX_EMBED_CHARS}-character embed limit") + return projection + + def render_page(self, projection: Mapping[str, Any], page: int) -> discord.Embed: + normalized = self.validate_projection(projection) + pages = normalized["pages"] + index = page % len(pages) + data = pages[index] + embed = discord.Embed( + title=data["title"], + description=data["description"] or None, + ) + for field in data["fields"]: + embed.add_field(name=field["name"], value=field["value"], inline=field["inline"]) + if data["links"]: + embed.add_field( + name="Links", + value="\n".join(f"[{link['label']}]({link['url']})" for link in data["links"]), + inline=False, + ) + embed.set_footer(text=_footer_text(data, index, len(pages))) + return embed + + +class ScheduledReportPaginationService: + """Persist normalized projections and redraw report pages by reaction.""" + + def __init__( + self, + *, + registry: ScheduledReportRendererRegistry, + data_path: Path, + get_channel: Callable[[int], discord.abc.Messageable | None], + max_reports: int = 100, + ) -> None: + if not data_path.is_absolute(): + raise ValueError("scheduled report state path must be absolute") + self._registry = registry + self._data_path = data_path + self._get_channel = get_channel + self._max_reports = max_reports + self._reports: dict[int, dict[str, Any]] = {} + self._lock = asyncio.Lock() + self._load() + + @property + def data_path(self) -> Path: + return self._data_path + + def _load(self) -> None: + if not self._data_path.exists(): + return + try: + records = json.loads(self._data_path.read_text()) + if not isinstance(records, list): + raise ValueError("state root must be an array") + now = datetime.now(UTC) + loaded: dict[int, dict[str, Any]] = {} + for record in records: + if not isinstance(record, dict): + continue + created = datetime.fromisoformat(str(record["created_at"])) + if created.tzinfo is None: + created = created.replace(tzinfo=UTC) + if (now - created).total_seconds() > MAX_REPORT_AGE_SECONDS: + continue + message_id = int(record["message_id"]) + report_format = str(record["format"]) + projection = self._registry.validate_projection(report_format, record["projection"]) + loaded[message_id] = { + "channel_id": int(record["channel_id"]), + "format": report_format, + "projection": projection, + "page": int(record.get("page", 0)) % len(projection["pages"]), + "created_at": created, + } + self._reports = loaded + self._prune_in_memory() + except Exception as exc: + log.warning("Could not load scheduled report state: %s", exc) + self._reports = {} + + def _save(self) -> None: + self._data_path.parent.mkdir(parents=True, exist_ok=True) + records = [ + { + "message_id": message_id, + "channel_id": state["channel_id"], + "format": state["format"], + "projection": state["projection"], + "page": state["page"], + "created_at": state["created_at"].isoformat(), + } + for message_id, state in self._reports.items() + ] + temp = self._data_path.with_suffix(self._data_path.suffix + ".tmp") + with open(temp, "w") as handle: + json.dump(records, handle, separators=(",", ":"), sort_keys=True) + handle.flush() + os.fsync(handle.fileno()) + os.replace(temp, self._data_path) + try: + directory_fd = os.open(self._data_path.parent, os.O_RDONLY) + try: + os.fsync(directory_fd) + finally: + os.close(directory_fd) + except OSError: + # Some filesystems do not permit directory fsync; the data file was + # still fsynced before the atomic replace. + pass + + def _save_best_effort(self, *, context: str) -> None: + try: + self._save() + except OSError as exc: + log.error("Could not persist scheduled report state after %s: %s", context, exc) + + def _prune_in_memory(self) -> bool: + now = datetime.now(UTC) + stale = [ + message_id + for message_id, state in self._reports.items() + if (now - state["created_at"]).total_seconds() > MAX_REPORT_AGE_SECONDS + ] + for message_id in stale: + self._reports.pop(message_id, None) + trimmed = False + while len(self._reports) > self._max_reports: + self._reports.pop(next(iter(self._reports))) + trimmed = True + return bool(stale) or trimmed + + def handles(self, message_id: int, emoji: Any) -> bool: + # Let handle_reaction perform age pruning under the service lock. A + # stale managed message is still ours for this one event; returning + # false here would bypass cleanup and leave it persisted indefinitely. + return message_id in self._reports and str(emoji) in CONTROL_REACTIONS + + async def post( + self, + channel: discord.abc.Messageable, + report_format: str, + raw_output: str, + ) -> discord.Message: + projection = self._registry.project(report_format, raw_output) + embed = self._registry.render_page(report_format, projection, 0) + message = await channel.send(embed=embed) + async with self._lock: + self._reports[message.id] = { + "channel_id": int(getattr(channel, "id", 0)), + "format": report_format, + "projection": projection, + "page": 0, + "created_at": datetime.now(UTC), + } + self._prune_in_memory() + self._save_best_effort(context="posting") + for emoji in REPORT_REACTIONS: + try: + await message.add_reaction(emoji) + except (discord.Forbidden, discord.HTTPException): + log.warning( + "Could not add scheduled-report reaction %s to message %s", + emoji, + message.id, + ) + return message + + async def handle_reaction(self, payload: discord.RawReactionActionEvent) -> bool: + """Redraw from persisted projection only; refresh never reruns a check.""" + emoji = str(payload.emoji) + if emoji not in CONTROL_REACTIONS: + return False + async with self._lock: + changed = self._prune_in_memory() + state = self._reports.get(payload.message_id) + if state is None: + if changed: + self._save_best_effort(context="state pruning") + return False + page_count = len(state["projection"]["pages"]) + current = int(state["page"]) % page_count + if emoji in LEFT_REACTIONS: + current = (current - 1) % page_count + elif emoji in RIGHT_REACTIONS: + current = (current + 1) % page_count + # REFRESH_REACTIONS intentionally leave current unchanged. The only + # side effect below is fetching/editing the existing message. + embed = self._registry.render_page(state["format"], state["projection"], current) + channel = self._get_channel(payload.channel_id) + if channel is None: + return False + try: + message = await channel.fetch_message(payload.message_id) # type: ignore[attr-defined] + await message.edit(embed=embed) + state["page"] = current + self._save_best_effort(context="page redraw") + try: + await message.remove_reaction(payload.emoji, discord.Object(id=payload.user_id)) + except (discord.Forbidden, discord.HTTPException): + pass + except discord.NotFound: + self._reports.pop(payload.message_id, None) + self._save_best_effort(context="message removal") + return False + except (discord.Forbidden, discord.HTTPException, AttributeError) as exc: + log.warning( + "Could not redraw scheduled report message %s; retaining state: %s", + payload.message_id, + exc, + ) + return False + return True diff --git a/src/discord/wiring.py b/src/discord/wiring.py index 1b3a156a..832115bb 100644 --- a/src/discord/wiring.py +++ b/src/discord/wiring.py @@ -74,6 +74,11 @@ from .native_tools.scheduling import SchedulingTools from .prompts import PromptBuilder from .scheduled_events import ScheduledEventHandlers, ScheduledEventsDeps +from .scheduled_report import ( + PaginatedEmbedV1Renderer, + ScheduledReportPaginationService, + ScheduledReportRendererRegistry, +) from .tool_catalog import ToolCatalog from .tool_loop import ToolLoopDeps, ToolLoopRunner from .turn_recorder import TurnRecorder @@ -599,6 +604,8 @@ class BotComponents: turn_recorder: TurnRecorder tool_loop: ToolLoopRunner scheduled_events: ScheduledEventHandlers + scheduled_report_renderers: ScheduledReportRendererRegistry + scheduled_reports: ScheduledReportPaginationService agent_task_tools: AgentTaskTools housekeeping: Housekeeping pipeline: MessagePipeline @@ -821,6 +828,19 @@ def build_components(bot, services: BotServices) -> BotComponents: native_tools.owners["agents"] = agent_task_tools register_native_handlers(native_tools) + scheduled_report_renderers = ScheduledReportRendererRegistry() + scheduled_report_renderers.register(PaginatedEmbedV1Renderer()) + services.scheduler.set_known_report_formats_provider( + lambda: scheduled_report_renderers.formats + ) + scheduled_reports = ScheduledReportPaginationService( + registry=scheduled_report_renderers, + # The scheduler's configured persistence directory is the shared data + # root. Resolve it once so report state never depends on process cwd. + data_path=(services.scheduler.data_path.parent.resolve() / "scheduled_reports.json"), + get_channel=lambda cid: bot.get_channel(cid), + ) + scheduled_events = ScheduledEventHandlers( ScheduledEventsDeps( get_config=lambda: bot.config, @@ -834,6 +854,7 @@ def build_components(bot, services: BotServices) -> BotComponents: llm_gateway=llm_gateway, tool_loop=tool_loop, agent_task_tools=agent_task_tools, + scheduled_reports=scheduled_reports, ) ) housekeeping = Housekeeping( @@ -922,6 +943,8 @@ async def _fetch_message(channel_id: str, message_id: str): turn_recorder=turn_recorder, tool_loop=tool_loop, scheduled_events=scheduled_events, + scheduled_report_renderers=scheduled_report_renderers, + scheduled_reports=scheduled_reports, agent_task_tools=agent_task_tools, housekeeping=housekeeping, pipeline=pipeline, diff --git a/src/scheduler/scheduler.py b/src/scheduler/scheduler.py index 74cf8c89..10d9195a 100644 --- a/src/scheduler/scheduler.py +++ b/src/scheduler/scheduler.py @@ -7,7 +7,7 @@ import re import time import uuid -from collections.abc import Awaitable, Callable +from collections.abc import Awaitable, Callable, Collection from datetime import UTC, datetime, timedelta from pathlib import Path from typing import Any, cast @@ -124,6 +124,7 @@ def __init__(self, data_path: str, history_path: str | None = None) -> None: self._task: asyncio.Task | None = None self._callback: Callable[[dict], Awaitable[None]] | None = None self._failure_callback: Callable[[dict, int], Awaitable[None]] | None = None + self._known_report_formats_provider: Callable[[], Collection[str]] | None = None self._lock = asyncio.Lock() self._wake = asyncio.Event() # Schedule ids currently executing — prevents the same schedule from @@ -192,6 +193,32 @@ def _save(self) -> None: os.fsync(f.fileno()) os.replace(tmp, self.data_path) + def set_known_report_formats_provider( + self, provider: Callable[[], Collection[str]] + ) -> None: + """Install the composition-owned source of supported report formats.""" + if not callable(provider): + raise TypeError("known report formats provider must be callable") + self._known_report_formats_provider = provider + + def _validate_report_format(self, report_format: str | None, action: str) -> None: + if report_format is not None and not isinstance(report_format, str): + raise ValueError("report_format must be a string") + if report_format and action != "check": + raise ValueError("report_format is only valid for 'check' actions") + if not report_format: + return + + provider = self._known_report_formats_provider + if provider is None: + raise ValueError("No scheduled report formats are registered") + try: + known_formats = frozenset(provider()) + except Exception as exc: + raise ValueError("Scheduled report formats are unavailable") from exc + if report_format not in known_formats: + raise ValueError(f"Unsupported scheduled report format: {report_format}") + async def add( self, description: str, @@ -209,7 +236,9 @@ async def add( webhook_config: dict | None = None, requester_id: str = "", cron_timezone: str | None = None, + report_format: str | None = None, ) -> dict: + self._validate_report_format(report_format, action) if action == "digest": # Digest is a predefined action, no tool validation needed pass @@ -279,6 +308,8 @@ async def add( elif action == "check": schedule["tool_name"] = tool_name schedule["tool_input"] = tool_input or {} + if report_format: + schedule["report_format"] = report_format elif action == "webhook": # action == "webhook" already raised unless webhook_config is a dict. schedule["webhook_config"] = self._normalize_webhook_config( @@ -635,6 +666,7 @@ async def update( webhook_config: dict | None = None, paused: bool | None = None, cron_timezone: str | None = None, + report_format: str | None = None, ) -> dict | None: """Update mutable fields on an existing schedule. @@ -688,6 +720,12 @@ async def update( target["tool_name"] = tool_name if tool_input is not None: target["tool_input"] = tool_input + if report_format is not None: + self._validate_report_format(report_format, target.get("action", "")) + if report_format: + target["report_format"] = report_format + else: + target.pop("report_format", None) if steps is not None: target["steps"] = steps if webhook_config is not None: diff --git a/src/tools/defs/media_scheduling.py b/src/tools/defs/media_scheduling.py index 5b9cef7c..617cd4e4 100644 --- a/src/tools/defs/media_scheduling.py +++ b/src/tools/defs/media_scheduling.py @@ -174,6 +174,14 @@ "'command' and 'host' shortcuts below for run_command." ), }, + "report_format": { + "type": "string", + "enum": ["paginated_embed_v1"], + "description": ( + "Optional generic paginated Discord embed renderer for a check result. " + "The command must emit the paginated_embed_v1 JSON contract." + ), + }, "command": { "type": "string", "description": ( @@ -241,7 +249,7 @@ "description": ( "Updates an existing schedule by ID. Only provided fields are changed. " "Can change description, cron, run_at, trigger, message, tool_name, tool_input, steps, " - "channel_id, or paused. " + "channel_id, report_format, or paused. " "Changing timing (cron/run_at/trigger) replaces the previous timing mode. " "Set paused=true to suspend a schedule without deleting it; paused=false to resume." ), @@ -290,6 +298,14 @@ "type": "object", "description": "New tool input parameters", }, + "report_format": { + "type": "string", + "enum": ["paginated_embed_v1", ""], + "description": ( + "Generic paginated Discord embed renderer for check output; empty string " + "disables structured rendering." + ), + }, "steps": { "type": "array", "description": "New workflow steps", diff --git a/src/web/api/schedules_api.py b/src/web/api/schedules_api.py index 72d4944a..27204c87 100644 --- a/src/web/api/schedules_api.py +++ b/src/web/api/schedules_api.py @@ -69,6 +69,8 @@ async def create_schedule(request: web.Request) -> web.Response: trigger=data.get("trigger"), max_retries=data.get("max_retries"), retry_backoff_seconds=data.get("retry_backoff_seconds"), + cron_timezone=data.get("cron_timezone"), + report_format=data.get("report_format"), ) return web.json_response(schedule, status=201) except (ValueError, TypeError) as e: @@ -108,6 +110,8 @@ async def update_schedule(request: web.Request) -> web.Response: max_retries=data.get("max_retries"), retry_backoff_seconds=data.get("retry_backoff_seconds"), paused=paused, + cron_timezone=data.get("cron_timezone"), + report_format=data.get("report_format"), ) except (ValueError, TypeError) as e: return web.json_response({"error": _sanitize_error(e)}, status=400) diff --git a/tests/characterization/test_tool_parity.py b/tests/characterization/test_tool_parity.py index 7f515b1f..1a5b3618 100644 --- a/tests/characterization/test_tool_parity.py +++ b/tests/characterization/test_tool_parity.py @@ -61,12 +61,11 @@ "purge_messages": "db35efc321c205b1", "post_file": "6860faab30251338", "generate_file": "2f4687a63e985fdd", - # Updated 2026-08-04: run_at now requires an explicit offset at the - # scheduler boundary, so the tool must not advertise an invalid naive ISO. - "schedule_task": "f06f1865a4ec7e95", + # Updated 2026-08-21: generic paginated scheduled-report format added. + "schedule_task": "17746160fd0b2d3f", "list_schedules": "6f72cb95cee9eb6c", - # Updated with schedule_task: scheduler updates reject naive run_at too. - "update_schedule": "35c886de5f87cb5d", + # Updated with schedule_task: report_format may be changed or cleared. + "update_schedule": "4635df8029e5e548", "delete_schedule": "01e54d37b70471a8", "parse_time": "6ae3f4c04138a2cd", "search_history": "d3d173bfe5262866", diff --git a/tests/test_native_scheduling.py b/tests/test_native_scheduling.py index ecf5b448..ef1beb56 100644 --- a/tests/test_native_scheduling.py +++ b/tests/test_native_scheduling.py @@ -163,3 +163,61 @@ def test_parse_time(self): assert "→ 2026-07-07T14:00" in t._handle_parse_time({"expression": "in 2 hours"}) with patch("src.tools.time_parser.parse_time", side_effect=ValueError("nope")): assert "Error: nope" in t._handle_parse_time({"expression": "gibberish"}) + + +class TestReportFormatNativeParity: + async def test_create_passes_generic_format(self): + scheduler = MagicMock() + scheduler.add = AsyncMock(return_value={ + "id": "S1", "description": "structured", "cron": "0 * * * *", + "next_run": "soon", "report_format": "paginated_embed_v1", + }) + result = await _tools(scheduler)._handle_schedule_task( + _message(), { + "description": "structured", "action": "check", "cron": "0 * * * *", + "tool_name": "run_command", "tool_input": {"command": "status"}, + "report_format": "paginated_embed_v1", + }) + assert "Scheduled recurring" in result + assert scheduler.add.await_args.kwargs["report_format"] == "paginated_embed_v1" + + async def test_update_passes_and_can_clear_format(self): + scheduler = MagicMock() + scheduler.update = AsyncMock(return_value={"id": "S1"}) + result = await _tools(scheduler)._handle_update_schedule( + {"schedule_id": "S1", "report_format": ""}) + assert result == "Updated schedule S1." + scheduler.update.assert_awaited_once_with("S1", report_format="") + + +class TestUnknownReportFormatNativeRejection: + @staticmethod + def _scheduler(tmp_path): + from src.scheduler.scheduler import Scheduler + + scheduler = Scheduler(str(tmp_path / "schedules.json")) + scheduler.set_known_report_formats_provider(lambda: ("paginated_embed_v1",)) + return scheduler + + async def test_native_add_rejects_unknown_format(self, tmp_path): + scheduler = self._scheduler(tmp_path) + result = await _tools(scheduler)._handle_schedule_task( + _message(), { + "description": "structured", "action": "check", "cron": "0 * * * *", + "tool_name": "run_command", "tool_input": {"command": "status"}, + "report_format": "paginated_embed_v2", + }) + assert "Unsupported scheduled report format: paginated_embed_v2" in result + assert scheduler.list_all() == [] + + async def test_native_update_rejects_unknown_format(self, tmp_path): + scheduler = self._scheduler(tmp_path) + created = await scheduler.add( + description="plain", action="check", channel_id="42", cron="0 * * * *", + tool_name="run_command", tool_input={"command": "status"}) + result = await _tools(scheduler)._handle_update_schedule({ + "schedule_id": created["id"], + "report_format": "paginated_embed_v2", + }) + assert "Unsupported scheduled report format: paginated_embed_v2" in result + assert "report_format" not in scheduler.list_all()[0] diff --git a/tests/test_reaction_triggers.py b/tests/test_reaction_triggers.py index ad913607..37f302c8 100644 --- a/tests/test_reaction_triggers.py +++ b/tests/test_reaction_triggers.py @@ -655,3 +655,53 @@ async def cb(schedule): assert count == 1 assert fired_schedules[0]["description"] == "Reaction trigger" + + +class TestScheduledReportPaginationInjection: + async def test_pagination_runs_when_generic_triggers_are_disabled(self): + pagination = MagicMock() + pagination.handles.return_value = True + pagination.handle_reaction = AsyncMock(return_value=True) + scheduler = _make_scheduler() + cog = ReactionTriggers( + _make_bot(), config=_make_config(enabled=False), + scheduler=scheduler, pagination=pagination) + payload = _make_payload(emoji_name="➡️") + await cog.on_raw_reaction_add(payload) + pagination.handle_reaction.assert_awaited_once_with(payload) + scheduler.fire_triggers.assert_not_awaited() + + async def test_pagination_precedes_generic_allowlists(self): + pagination = MagicMock() + pagination.handles.return_value = True + pagination.handle_reaction = AsyncMock(return_value=True) + scheduler = _make_scheduler() + cog = ReactionTriggers( + _make_bot(), + config=_make_config(enabled=True, channel_ids=["999"], allowed_user_ids=["999"]), + scheduler=scheduler, pagination=pagination) + payload = _make_payload(emoji_name="🔄") + await cog.on_raw_reaction_add(payload) + pagination.handle_reaction.assert_awaited_once_with(payload) + scheduler.fire_triggers.assert_not_awaited() + + async def test_non_report_reaction_falls_through_to_scheduler(self): + pagination = MagicMock() + pagination.handles.return_value = False + pagination.handle_reaction = AsyncMock() + scheduler = _make_scheduler(fired=1) + cog = ReactionTriggers( + _make_bot(), config=_make_config(enabled=True), + scheduler=scheduler, pagination=pagination) + await cog.on_raw_reaction_add(_make_payload()) + pagination.handle_reaction.assert_not_awaited() + scheduler.fire_triggers.assert_awaited_once() + + async def test_bot_reaction_is_ignored_before_pagination(self): + pagination = MagicMock() + pagination.handles.return_value = True + pagination.handle_reaction = AsyncMock() + cog = ReactionTriggers(_make_bot(), pagination=pagination) + await cog.on_raw_reaction_add(_make_payload(user_id=123456789)) + pagination.handles.assert_not_called() + pagination.handle_reaction.assert_not_awaited() diff --git a/tests/test_schedule_report_format_parity.py b/tests/test_schedule_report_format_parity.py new file mode 100644 index 00000000..c1a4f588 --- /dev/null +++ b/tests/test_schedule_report_format_parity.py @@ -0,0 +1,44 @@ +"""Cross-surface parity for the generic scheduled report format field.""" +from __future__ import annotations + +import inspect +from pathlib import Path + +from src.discord.native_tools.scheduling import SchedulingTools +from src.scheduler.scheduler import Scheduler +from src.tools.registry import TOOL_MAP +from src.web.api.schedules_api import register_schedules + +FORMAT = "paginated_embed_v1" +ROOT = Path(__file__).resolve().parents[1] + + +def test_native_tool_schemas_agree_on_report_format(): + create = TOOL_MAP["schedule_task"]["input_schema"]["properties"]["report_format"] + update = TOOL_MAP["update_schedule"]["input_schema"]["properties"]["report_format"] + assert create["enum"] == [FORMAT] + assert update["enum"] == [FORMAT, ""] + assert "generic" in create["description"].lower() + assert "generic" in update["description"].lower() + + +def test_scheduler_native_and_web_surfaces_all_forward_the_field(): + add_signature = inspect.signature(Scheduler.add) + update_signature = inspect.signature(Scheduler.update) + assert "report_format" in add_signature.parameters + assert "report_format" in update_signature.parameters + + native = inspect.getsource(SchedulingTools) + web = inspect.getsource(register_schedules) + assert 'report_format=inp.get("report_format")' in native + assert '"report_format",' in native + assert web.count('report_format=data.get("report_format")') == 2 + + +def test_webui_create_and_readback_use_the_same_field_and_literal(): + source = (ROOT / "ui/js/pages/schedules.js").read_text() + assert "form.report_format" in source + assert "payload.report_format = f.report_format" in source + assert "s.report_format || ''" in source + assert "report_format: reportFormat" in source + assert f'value="{FORMAT}"' in source diff --git a/tests/test_scheduled_events.py b/tests/test_scheduled_events.py index fb5856d4..f058a41c 100644 --- a/tests/test_scheduled_events.py +++ b/tests/test_scheduled_events.py @@ -45,6 +45,7 @@ def _deps(**ov): active_client=SimpleNamespace(chat=AsyncMock(return_value="LLM summary"))), tool_loop=MagicMock(dispatch_loop_tool_inner=AsyncMock(return_value="dispatched")), agent_task_tools=MagicMock(), + scheduled_reports=MagicMock(post=AsyncMock()), ) d.update(ov) return ScheduledEventsDeps(**d) @@ -386,3 +387,77 @@ async def test_task_workflow_and_unknown(self): await h2._on_scheduled_task( {"id": "S1", "channel_id": "1", "action": "mystery"} ) + + +class TestStructuredCheckReports: + async def test_report_format_dispatches_raw_result_to_pagination_service(self): + channel = _channel() + reports = MagicMock(post=AsyncMock()) + raw = '{"format":"paginated_embed_v1","pages":[]}' + handler = _handlers( + get_channel=lambda _cid: channel, + tool_loop=MagicMock(dispatch_loop_tool_inner=AsyncMock(return_value=raw)), + scheduled_reports=reports, + ) + await handler._on_scheduled_task({ + "id": "S1", "description": "structured", "channel_id": "1", + "action": "check", "tool_name": "run_command", + "tool_input": {"command": "status"}, + "report_format": "paginated_embed_v1", + }) + reports.post.assert_awaited_once_with(channel, "paginated_embed_v1", raw) + channel.send.assert_not_awaited() + + async def test_report_service_unavailable_uses_failure_path(self): + channel = _channel() + handler = _handlers( + get_channel=lambda _cid: channel, + scheduled_reports=None, + ) + with pytest.raises(RuntimeError, match="service is unavailable"): + await handler._on_scheduled_task({ + "id": "S1", "description": "structured", "channel_id": "1", + "action": "check", "tool_name": "run_command", + "report_format": "paginated_embed_v1", + }) + + async def test_renderer_failure_uses_existing_check_failure_path(self): + channel = _channel() + reports = MagicMock(post=AsyncMock(side_effect=ValueError("bad payload"))) + handler = _handlers(get_channel=lambda _cid: channel, scheduled_reports=reports) + with pytest.raises(RuntimeError, match="Failed to render scheduled report"): + await handler._on_scheduled_task({ + "id": "S1", "description": "structured", "channel_id": "1", + "action": "check", "tool_name": "run_command", + "tool_input": {"command": "status"}, "report_format": "unknown_v1", + }) + assert "Scheduled report failed" in channel.send.await_args.args[0] + + async def test_renderer_failure_notice_failure_is_swallowed(self): + channel = _channel() + channel.send = AsyncMock(side_effect=RuntimeError("discord down")) + reports = MagicMock(post=AsyncMock(side_effect=ValueError("bad payload"))) + handler = _handlers( + get_channel=lambda _cid: channel, + scheduled_reports=reports, + ) + with pytest.raises(RuntimeError, match="Failed to render scheduled report"): + await handler._on_scheduled_task({ + "id": "S1", "description": "structured", "channel_id": "1", + "action": "check", "tool_name": "run_command", + "report_format": "paginated_embed_v1", + }) + + async def test_legacy_check_output_is_byte_identical_at_truncation_boundary(self): + channel = _channel() + raw = "x" * 1801 + handler = _handlers( + get_channel=lambda _cid: channel, + tool_loop=MagicMock(dispatch_loop_tool_inner=AsyncMock(return_value=raw)), + ) + await handler._on_scheduled_task({ + "id": "S1", "channel_id": "1", "action": "check", + "tool_name": "t", "description": "d", + }) + channel.send.assert_awaited_once_with( + "**Scheduled: d**\n```\n" + ("x" * 1800) + "\n```") diff --git a/tests/test_scheduled_report.py b/tests/test_scheduled_report.py new file mode 100644 index 00000000..13dabdd9 --- /dev/null +++ b/tests/test_scheduled_report.py @@ -0,0 +1,539 @@ +"""Generic scheduled-report contract, persistence, and pagination tests.""" + +from __future__ import annotations + +import json +from datetime import UTC, datetime, timedelta +from types import SimpleNamespace +from unittest.mock import AsyncMock, MagicMock, patch + +import pytest + +from src.discord.scheduled_report import ( + MAX_DESCRIPTION_CHARS, + MAX_EMBED_CHARS, + MAX_FIELD_NAME_CHARS, + MAX_FIELD_VALUE_CHARS, + MAX_FIELDS_PER_PAGE, + MAX_FOOTER_INPUT_CHARS, + MAX_LINK_LABEL_CHARS, + MAX_LINK_URL_CHARS, + MAX_LINKS, + MAX_PAGES, + MAX_TITLE_CHARS, + PAGINATED_EMBED_V1, + PaginatedEmbedV1Renderer, + ScheduledReportPaginationService, + ScheduledReportRendererRegistry, +) + + +def _registry(): + registry = ScheduledReportRendererRegistry() + registry.register(PaginatedEmbedV1Renderer()) + return registry + + +def _payload(**page_overrides): + page = { + "title": "Status", + "description": "Everything is nominal.", + "fields": [{"name": "Check", "value": "Healthy", "inline": True}], + "footer": "Generated recently", + "links": [{"label": "Details", "url": "https://example.com/report"}], + } + page.update(page_overrides) + return {"format": PAGINATED_EMBED_V1, "pages": [page]} + + +class TestPaginatedEmbedV1Contract: + def test_required_optional_defaults_and_rendering(self): + registry = _registry() + projection = registry.project( + PAGINATED_EMBED_V1, + json.dumps( + { + "format": PAGINATED_EMBED_V1, + "pages": [ + {"title": "One"}, + { + "title": "Two", + "description": "Body", + "fields": [{"name": "N", "value": "V"}], + "footer": "Footer", + "links": [{"label": "Docs", "url": "https://example.com"}], + }, + ], + } + ), + ) + assert projection["pages"][0] == { + "title": "One", + "description": "", + "fields": [], + "footer": "", + "links": [], + } + embed = registry.render_page(PAGINATED_EMBED_V1, projection, 1) + data = embed.to_dict() + assert data["title"] == "Two" + assert data["fields"][0] == {"name": "N", "value": "V", "inline": False} + assert data["fields"][1]["name"] == "Links" + assert data["footer"]["text"].startswith("Footer · Page 2/2") + + def test_empty_pages_normalize_to_bounded_empty_state(self): + projection = _registry().project( + PAGINATED_EMBED_V1, + json.dumps({"format": PAGINATED_EMBED_V1, "pages": []}), + ) + assert projection["pages"] == [ + { + "title": "Scheduled report", + "description": "No report data.", + "fields": [], + "footer": "", + "links": [], + } + ] + + @pytest.mark.parametrize( + "payload,error", + [ + ([], "must be an object"), + ({"format": PAGINATED_EMBED_V1}, "pages must be an array"), + ({"format": "other", "pages": []}, "report.format"), + ({"format": PAGINATED_EMBED_V1, "pages": [], "junk": 1}, "unknown keys"), + ({"format": PAGINATED_EMBED_V1, "pages": ["junk"]}, "must be an object"), + ({"format": PAGINATED_EMBED_V1, "pages": [{}]}, "title is required"), + ({"format": PAGINATED_EMBED_V1, "pages": [{"title": 1}]}, "must be a string"), + ({"format": PAGINATED_EMBED_V1, "pages": [{"title": " "}]}, "non-empty"), + ({"format": PAGINATED_EMBED_V1, "pages": [{"title": "x", "junk": 1}]}, "unknown keys"), + ( + {"format": PAGINATED_EMBED_V1, "pages": [{"title": "x", "fields": {}}]}, + "fields must be an array", + ), + ( + {"format": PAGINATED_EMBED_V1, "pages": [{"title": "x", "fields": [1]}]}, + "must be an object", + ), + ( + { + "format": PAGINATED_EMBED_V1, + "pages": [{"title": "x", "fields": [{"name": "n"}]}], + }, + "requires name and value", + ), + ( + { + "format": PAGINATED_EMBED_V1, + "pages": [{"title": "x", "fields": [{"name": "n", "value": "v", "inline": 1}]}], + }, + "must be a boolean", + ), + ( + {"format": PAGINATED_EMBED_V1, "pages": [{"title": "x", "links": {}}]}, + "links must be an array", + ), + ( + { + "format": PAGINATED_EMBED_V1, + "pages": [{"title": "x", "links": [{"label": "l"}]}], + }, + "requires label and url", + ), + ], + ) + def test_hostile_shapes_are_rejected(self, payload, error): + with pytest.raises(ValueError, match=error): + _registry().project(PAGINATED_EMBED_V1, json.dumps(payload)) + + @pytest.mark.parametrize( + "overrides,error", + [ + ({"title": "x" * (MAX_TITLE_CHARS + 1)}, "title exceeds"), + ({"description": "x" * (MAX_DESCRIPTION_CHARS + 1)}, "description exceeds"), + ({"footer": "x" * (MAX_FOOTER_INPUT_CHARS + 1)}, "footer exceeds"), + ( + {"fields": [{"name": "x" * (MAX_FIELD_NAME_CHARS + 1), "value": "v"}]}, + "name exceeds", + ), + ( + {"fields": [{"name": "n", "value": "x" * (MAX_FIELD_VALUE_CHARS + 1)}]}, + "value exceeds", + ), + ( + { + "links": [ + {"label": "x" * (MAX_LINK_LABEL_CHARS + 1), "url": "https://example.com"} + ] + }, + "label exceeds", + ), + ( + { + "links": [ + {"label": "x", "url": "https://example.com/" + "x" * MAX_LINK_URL_CHARS} + ] + }, + "1-512", + ), + ({"links": [{"label": "x", "url": "javascript:alert(1)"}]}, "absolute HTTP"), + ({"links": [{"label": "x", "url": "https://user:pass@example.com"}]}, "credentials"), + ({"links": [{"label": "x", "url": "https://example.com/bad path"}]}, "whitespace"), + ({"links": [{"label": "x", "url": "https://example.com/\u0001"}]}, "control"), + ({"links": [{"label": "x", "url": "https://example.com:99999"}]}, "valid URL"), + ], + ) + def test_hard_character_and_link_caps(self, overrides, error): + with pytest.raises(ValueError, match=error): + _registry().project(PAGINATED_EMBED_V1, json.dumps(_payload(**overrides))) + + def test_page_field_link_and_embed_caps(self): + registry = _registry() + with pytest.raises(ValueError, match="10-page"): + registry.project( + PAGINATED_EMBED_V1, + json.dumps( + {"format": PAGINATED_EMBED_V1, "pages": [{"title": "x"}] * (MAX_PAGES + 1)} + ), + ) + with pytest.raises(ValueError, match="rendered fields"): + registry.project( + PAGINATED_EMBED_V1, + json.dumps( + _payload(fields=[{"name": "n", "value": "v"}] * (MAX_FIELDS_PER_PAGE + 1)) + ), + ) + with pytest.raises(ValueError, match="10-link"): + registry.project( + PAGINATED_EMBED_V1, + json.dumps( + _payload( + links=[ + {"label": "x", "url": f"https://example.com/{i}"} + for i in range(MAX_LINKS + 1) + ] + ) + ), + ) + # Every component is below its own cap, but their sum exceeds Discord's + # 6,000-character per-embed aggregate limit. + aggregate = _payload( + title="t" * MAX_TITLE_CHARS, + description="d" * MAX_DESCRIPTION_CHARS, + fields=[{"name": "n", "value": "v" * MAX_FIELD_VALUE_CHARS}], + footer="f" * 700, + links=[], + ) + with pytest.raises(ValueError, match=str(MAX_EMBED_CHARS)): + registry.project(PAGINATED_EMBED_V1, json.dumps(aggregate)) + + def test_parse_first_then_scrub_rendered_strings_only(self): + raw = json.dumps( + { + "format": PAGINATED_EMBED_V1, + "pages": [{"title": "token=super-secret", "description": "@everyone **raw**"}], + } + ) + with patch( + "src.discord.scheduled_report.scrub_response_secrets", + side_effect=lambda value: value.replace("super-secret", "[REDACTED]"), + ) as scrub: + projection = _registry().project(PAGINATED_EMBED_V1, raw) + assert scrub.call_count == 3 # title, description, and default footer + assert projection["pages"][0]["title"] == r"token=\[REDACTED\]" + assert "@\u200beveryone" in projection["pages"][0]["description"] + assert r"\*\*raw\*\*" in projection["pages"][0]["description"] + assert "super-secret" not in json.dumps(projection) + + def test_freeform_text_cannot_create_clickable_links(self): + projection = _registry().project( + PAGINATED_EMBED_V1, + json.dumps(_payload(description="[click](https://example.com) ")), + ) + description = projection["pages"][0]["description"] + assert description == ( + r"\[click\]\(https://example.com\) \" + ) + + def test_link_urls_are_scrubbed_after_parse_before_validation(self): + raw = json.dumps( + _payload( + links=[ + { + "label": "Details", + "url": "https://example.com/?token=super-secret", + } + ] + ) + ) + with patch( + "src.discord.scheduled_report.scrub_response_secrets", + side_effect=lambda value: value.replace("super-secret", "redacted"), + ): + projection = _registry().project(PAGINATED_EMBED_V1, raw) + assert projection["pages"][0]["links"][0]["url"].endswith("token=redacted") + assert "super-secret" not in json.dumps(projection) + + def test_unknown_registry_format_is_rejected_at_render_time(self): + with pytest.raises(ValueError, match="Unsupported scheduled report format"): + _registry().project("unknown_v1", "{}") + + +class _Message: + def __init__(self, message_id=99): + self.id = message_id + self.add_reaction = AsyncMock() + self.edit = AsyncMock() + self.remove_reaction = AsyncMock() + + +class _Channel: + def __init__(self, channel_id=42, message=None): + self.id = channel_id + self.message = message or _Message() + self.send = AsyncMock(return_value=self.message) + self.fetch_message = AsyncMock(return_value=self.message) + + +def _reaction(*, emoji="➡️", message_id=99, channel_id=42, user_id=7): + return SimpleNamespace( + emoji=emoji, + message_id=message_id, + channel_id=channel_id, + user_id=user_id, + ) + + +class TestPaginationState: + async def test_post_persists_only_normalized_projection_and_reloads(self, tmp_path): + state_path = (tmp_path / "scheduled_reports.json").resolve() + channel = _Channel() + service = ScheduledReportPaginationService( + registry=_registry(), data_path=state_path, get_channel=lambda _cid: channel + ) + raw = json.dumps(_payload(title="**Title**", description="@everyone")) + await service.post(channel, PAGINATED_EMBED_V1, raw) + + stored = json.loads(state_path.read_text()) + assert set(stored[0]) == { + "message_id", + "channel_id", + "format", + "projection", + "page", + "created_at", + } + projection = stored[0]["projection"] + assert "payload" not in stored[0] + assert "raw_output" not in stored[0] + assert projection["pages"][0]["title"] == r"\*\*Title\*\*" + assert projection["pages"][0]["description"] == "@\u200beveryone" + + reloaded = ScheduledReportPaginationService( + registry=_registry(), data_path=state_path, get_channel=lambda _cid: channel + ) + assert reloaded.handles(99, "➡️") + assert await reloaded.handle_reaction(_reaction()) + channel.message.edit.assert_awaited_once() + + async def test_refresh_is_redraw_only_and_does_not_reproject_or_execute(self, tmp_path): + state_path = (tmp_path / "scheduled_reports.json").resolve() + channel = _Channel() + registry = _registry() + service = ScheduledReportPaginationService( + registry=registry, data_path=state_path, get_channel=lambda _cid: channel + ) + await service.post( + channel, + PAGINATED_EMBED_V1, + json.dumps( + { + "format": PAGINATED_EMBED_V1, + "pages": [{"title": "Page one"}, {"title": "Page two"}], + } + ), + ) + with patch.object(registry, "project", side_effect=AssertionError("refresh reprojected")): + assert await service.handle_reaction(_reaction(emoji="🔄")) + edited = channel.message.edit.await_args.kwargs["embed"].to_dict() + assert edited["title"] == "Page one" + assert json.loads(state_path.read_text())[0]["page"] == 0 + + async def test_navigation_wraps_and_removes_user_reaction(self, tmp_path): + channel = _Channel() + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: channel, + ) + await service.post( + channel, + PAGINATED_EMBED_V1, + json.dumps( + { + "format": PAGINATED_EMBED_V1, + "pages": [{"title": "One"}, {"title": "Two"}], + } + ), + ) + assert await service.handle_reaction(_reaction(emoji="⬅️")) + assert channel.message.edit.await_args.kwargs["embed"].to_dict()["title"] == "Two" + channel.message.remove_reaction.assert_awaited_once() + + async def test_missing_message_removes_persisted_state(self, tmp_path): + import discord + + channel = _Channel() + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: channel, + ) + await service.post(channel, PAGINATED_EMBED_V1, json.dumps(_payload())) + response = MagicMock(status=404, reason="missing") + channel.fetch_message = AsyncMock(side_effect=discord.NotFound(response, "missing")) + assert not await service.handle_reaction(_reaction()) + assert not service.handles(99, "➡️") + + def test_requires_absolute_state_path_and_prunes_older_than_26h(self, tmp_path): + with pytest.raises(ValueError, match="absolute"): + ScheduledReportPaginationService( + registry=_registry(), + data_path=tmp_path.__class__("relative.json"), + get_channel=lambda _cid: None, + ) + state = [ + { + "message_id": 99, + "channel_id": 42, + "format": PAGINATED_EMBED_V1, + "projection": _registry().project(PAGINATED_EMBED_V1, json.dumps(_payload())), + "page": 0, + "created_at": (datetime.now(UTC) - timedelta(hours=27)).isoformat(), + } + ] + path = (tmp_path / "state.json").resolve() + path.write_text(json.dumps(state)) + service = ScheduledReportPaginationService( + registry=_registry(), data_path=path, get_channel=lambda _cid: None + ) + assert not service.handles(99, "➡️") + + async def test_stale_in_memory_state_is_pruned_and_persisted_on_reaction(self, tmp_path): + channel = _Channel() + path = (tmp_path / "state.json").resolve() + service = ScheduledReportPaginationService( + registry=_registry(), data_path=path, get_channel=lambda _cid: channel + ) + await service.post(channel, PAGINATED_EMBED_V1, json.dumps(_payload())) + service._reports[99]["created_at"] = datetime.now(UTC) - timedelta(hours=27) + assert service.handles(99, "➡️") + assert not await service.handle_reaction(_reaction()) + assert not service.handles(99, "➡️") + assert json.loads(path.read_text()) == [] + + +class TestRegistryAndPersistenceFailureEdges: + def test_duplicate_registration_and_formats(self): + registry = _registry() + assert registry.formats == (PAGINATED_EMBED_V1,) + with pytest.raises(ValueError, match="already registered"): + registry.register(PaginatedEmbedV1Renderer()) + + def test_malformed_json_has_stable_error(self): + with pytest.raises(ValueError, match="did not return valid JSON"): + _registry().project(PAGINATED_EMBED_V1, "{") + + def test_malformed_persisted_state_fails_closed(self, tmp_path): + path = (tmp_path / "state.json").resolve() + path.write_text("not-json") + service = ScheduledReportPaginationService( + registry=_registry(), data_path=path, get_channel=lambda _cid: None + ) + assert not service.handles(1, "➡️") + + async def test_reaction_unknown_emoji_or_message_is_ignored(self, tmp_path): + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: None, + ) + assert not await service.handle_reaction(_reaction(emoji="not-a-control")) + assert not await service.handle_reaction(_reaction(message_id=1234)) + + async def test_missing_channel_keeps_state_without_editing(self, tmp_path): + channel = _Channel() + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: None, + ) + await service.post(channel, PAGINATED_EMBED_V1, json.dumps(_payload())) + assert not await service.handle_reaction(_reaction()) + assert service.handles(99, "➡️") + + async def test_discord_edit_error_keeps_state(self, tmp_path): + import discord + + channel = _Channel() + response = MagicMock(status=403, reason="forbidden") + channel.message.edit = AsyncMock( + side_effect=discord.Forbidden(response, "forbidden") + ) + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: channel, + ) + await service.post(channel, PAGINATED_EMBED_V1, json.dumps(_payload())) + assert not await service.handle_reaction(_reaction()) + assert service.handles(99, "➡️") + + async def test_reaction_add_failures_do_not_fail_delivery(self, tmp_path): + import discord + + channel = _Channel() + response = MagicMock(status=403, reason="forbidden") + channel.message.add_reaction = AsyncMock( + side_effect=discord.Forbidden(response, "forbidden") + ) + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: channel, + ) + posted = await service.post( + channel, PAGINATED_EMBED_V1, json.dumps(_payload()) + ) + assert posted is channel.message + assert channel.message.add_reaction.await_count == 3 + + async def test_reaction_removal_failure_does_not_fail_redraw(self, tmp_path): + import discord + + channel = _Channel() + response = MagicMock(status=403, reason="forbidden") + channel.message.remove_reaction = AsyncMock( + side_effect=discord.Forbidden(response, "forbidden") + ) + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: channel, + ) + await service.post(channel, PAGINATED_EMBED_V1, json.dumps(_payload())) + assert await service.handle_reaction(_reaction()) + + async def test_persistence_failure_after_post_is_best_effort(self, tmp_path): + channel = _Channel() + service = ScheduledReportPaginationService( + registry=_registry(), + data_path=(tmp_path / "state.json").resolve(), + get_channel=lambda _cid: channel, + ) + with patch.object(service, "_save", side_effect=OSError("disk full")): + posted = await service.post( + channel, PAGINATED_EMBED_V1, json.dumps(_payload()) + ) + assert posted is channel.message diff --git a/tests/test_scheduled_report_wiring.py b/tests/test_scheduled_report_wiring.py new file mode 100644 index 00000000..74c97720 --- /dev/null +++ b/tests/test_scheduled_report_wiring.py @@ -0,0 +1,42 @@ +"""Composition-root contract for generic scheduled-report services.""" +from __future__ import annotations + +import ast +from pathlib import Path + +from src.discord.scheduled_report import PAGINATED_EMBED_V1 + +ROOT = Path(__file__).resolve().parents[1] + + +def test_registry_and_pagination_service_are_bot_components(): + source = (ROOT / "src/discord/wiring.py").read_text() + tree = ast.parse(source) + component_fields = set() + for node in tree.body: + if isinstance(node, ast.ClassDef) and node.name == "BotComponents": + component_fields = { + item.target.id + for item in node.body + if isinstance(item, ast.AnnAssign) + and isinstance(item.target, ast.Name) + } + assert {"scheduled_report_renderers", "scheduled_reports"} <= component_fields + assert "register(PaginatedEmbedV1Renderer())" in source + assert "services.scheduler.set_known_report_formats_provider(" in source + assert "lambda: scheduled_report_renderers.formats" in source + assert PAGINATED_EMBED_V1 == "paginated_embed_v1" + + +def test_pagination_is_injected_directly_into_reaction_cog(): + source = (ROOT / "src/discord/cogs/reaction_triggers.py").read_text() + assert "components = cast(Any, bot).components" in source + assert "pagination=components.scheduled_reports" in source + assert "bot.__dict__" not in source + assert "getattr(bot" not in source + + +def test_state_path_comes_from_configured_scheduler_persistence_root(): + source = (ROOT / "src/discord/wiring.py").read_text() + assert "services.scheduler.data_path.parent.resolve()" in source + assert 'data_path="./data/scheduled_reports.json"' not in source diff --git a/tests/test_scheduler_validation.py b/tests/test_scheduler_validation.py index 2476c717..2e841a1f 100644 --- a/tests/test_scheduler_validation.py +++ b/tests/test_scheduler_validation.py @@ -6,6 +6,9 @@ """ from __future__ import annotations +import hashlib +import inspect + import pytest from src.scheduler.scheduler import ( @@ -114,3 +117,83 @@ def test_content_matching(self, sched): assert m({"equals": "exact"}, "discord_message", {"content": "not exact"}) is False # empty trigger with any source → matches (no conditions) assert m({}, "generic", {}) is True + + +class TestReportFormatPersistence: + @staticmethod + def _install_formats(scheduler: Scheduler) -> None: + scheduler.set_known_report_formats_provider(lambda: ("paginated_embed_v1",)) + + async def test_update_format_and_clear_survive_real_reload_round_trips(self, tmp_path): + path = tmp_path / "schedules.json" + scheduler = Scheduler(data_path=str(path)) + created = await scheduler.add( + description="structured check", action="check", channel_id="1", + cron="0 * * * *", tool_name="run_command", + tool_input={"command": "status"}) + + self._install_formats(scheduler) + updated = await scheduler.update( + created["id"], report_format="paginated_embed_v1") + assert updated is not None + assert updated["report_format"] == "paginated_embed_v1" + + reloaded = Scheduler(data_path=str(path)) + assert reloaded.list_all()[0]["report_format"] == "paginated_embed_v1" + self._install_formats(reloaded) + cleared = await reloaded.update(created["id"], report_format="") + assert cleared is not None and "report_format" not in cleared + + cleared_reload = Scheduler(data_path=str(path)) + assert "report_format" not in cleared_reload.list_all()[0] + + async def test_unknown_format_and_absent_provider_fail_closed(self, tmp_path): + scheduler = Scheduler(data_path=str(tmp_path / "schedules.json")) + check = { + "description": "check", "action": "check", "channel_id": "1", + "cron": "0 * * * *", "tool_name": "run_command", + } + with pytest.raises(ValueError, match="No scheduled report formats are registered"): + await scheduler.add(**check, report_format="paginated_embed_v1") + + self._install_formats(scheduler) + with pytest.raises(ValueError, match="Unsupported scheduled report format"): + await scheduler.add(**check, report_format="paginated_embed_v2") + + async def test_format_is_only_valid_for_checks_and_strings(self, tmp_path): + scheduler = Scheduler(data_path=str(tmp_path / "schedules.json")) + self._install_formats(scheduler) + with pytest.raises(ValueError, match="only valid for 'check'"): + await scheduler.add( + description="reminder", action="reminder", channel_id="1", + cron="0 * * * *", report_format="paginated_embed_v1") + with pytest.raises(ValueError, match="must be a string"): + await scheduler.add( + description="check", action="check", channel_id="1", + cron="0 * * * *", tool_name="run_command", + report_format=123) # type: ignore[arg-type] + + +class TestOldCodeRollbackTolerance: + def test_v376_loader_and_saver_preserve_unknown_report_field(self, tmp_path): + expected = { + "_load": "3a68719075a2c6dfea5451b7f68cbb52c41455ecbf942260103fad385146871c", + "_save": "b6286b474494df9d27d24ba0f66c7e36707faaa4f49c61d877f15446d73842dc", + } + for method, digest in expected.items(): + source = inspect.getsource(getattr(Scheduler, method)).encode() + assert hashlib.sha256(source).hexdigest() == digest + import json + path = tmp_path / "schedules.json" + original = { + "id": "rollback", "description": "structured check", "action": "check", + "channel_id": "1", "cron": "0 * * * *", "one_time": False, + "next_run": "2999-01-01T00:00:00+00:00", "tool_name": "run_command", + "tool_input": {"command": "status"}, + "report_format": "paginated_embed_v1", + } + path.write_text(json.dumps([original])) + old_code_compatible = Scheduler(data_path=str(path)) + assert old_code_compatible.list_all()[0] == original + old_code_compatible._save() + assert json.loads(path.read_text())[0] == original diff --git a/tests/test_web_api_schedules.py b/tests/test_web_api_schedules.py index f8014af4..d0672005 100644 --- a/tests/test_web_api_schedules.py +++ b/tests/test_web_api_schedules.py @@ -170,3 +170,154 @@ async def test_preview_agrees_with_the_schedulers_own_computation(self): # Both anchor on "now", so allow a small window for clock movement # between the calls; the offset bug produced hours of skew. assert abs((preview_first - scheduler_next).total_seconds()) < 120 + + +class TestCronTimezoneApiParity: + @staticmethod + def _real_app(tmp_path): + from src.scheduler.scheduler import Scheduler + + bot = MagicMock() + bot.scheduler = Scheduler(str(tmp_path / "schedules.json")) + return _app(bot), bot.scheduler + + async def test_create_update_and_readback(self, tmp_path): + app, scheduler = self._real_app(tmp_path) + async with TestClient(TestServer(app)) as c: + created = await c.post( + "/api/schedules", + json={ + "description": "local morning", + "action": "reminder", + "channel_id": "1", + "cron": "0 9 * * *", + "cron_timezone": "America/New_York", + "message": "hello", + }, + ) + assert created.status == 201 + schedule = await created.json() + assert schedule["timezone"] == "America/New_York" + + listed = await (await c.get("/api/schedules")).json() + assert listed[0]["timezone"] == "America/New_York" + + updated = await c.put( + f"/api/schedules/{schedule['id']}", + json={"cron_timezone": "Europe/London"}, + ) + assert updated.status == 200 + assert (await updated.json())["timezone"] == "Europe/London" + + reread = await (await c.get("/api/schedules")).json() + assert reread[0]["timezone"] == "Europe/London" + assert scheduler.list_all()[0]["timezone"] == "Europe/London" + + async def test_invalid_timezone_is_a_400_on_create_and_update(self, tmp_path): + app, _scheduler = self._real_app(tmp_path) + async with TestClient(TestServer(app)) as c: + invalid_create = await c.post( + "/api/schedules", + json={ + "description": "bad zone", + "action": "reminder", + "channel_id": "1", + "cron": "0 9 * * *", + "cron_timezone": "Not/A_Timezone", + }, + ) + assert invalid_create.status == 400 + + created = await c.post( + "/api/schedules", + json={ + "description": "valid zone", + "action": "reminder", + "channel_id": "1", + "cron": "0 9 * * *", + "cron_timezone": "UTC", + }, + ) + schedule_id = (await created.json())["id"] + invalid_update = await c.put( + f"/api/schedules/{schedule_id}", + json={"cron_timezone": "Still/Not_A_Timezone"}, + ) + assert invalid_update.status == 400 + + +class TestReportFormatApiParity: + @staticmethod + def _real_bot(tmp_path): + from src.scheduler.scheduler import Scheduler + + bot = MagicMock() + bot.scheduler = Scheduler(str(tmp_path / "schedules.json")) + bot.scheduler.set_known_report_formats_provider( + lambda: ("paginated_embed_v1",) + ) + return bot + + async def test_create_update_and_readback(self, tmp_path): + bot = self._real_bot(tmp_path) + async with TestClient(TestServer(_app(bot))) as c: + created = await c.post("/api/schedules", json={ + "description": "structured", "action": "check", "channel_id": "1", + "cron": "0 * * * *", "tool_name": "run_command", + "tool_input": {"command": "status"}, + "report_format": "paginated_embed_v1", + }) + assert created.status == 201 + schedule = await created.json() + assert schedule["report_format"] == "paginated_embed_v1" + listed = await (await c.get("/api/schedules")).json() + assert listed[0]["report_format"] == "paginated_embed_v1" + cleared = await c.put( + f"/api/schedules/{schedule['id']}", json={"report_format": ""}) + assert cleared.status == 200 + assert "report_format" not in await cleared.json() + + async def test_invalid_type_and_non_check_use_return_400(self, tmp_path): + bot = self._real_bot(tmp_path) + async with TestClient(TestServer(_app(bot))) as c: + invalid_type = await c.post("/api/schedules", json={ + "description": "structured", "action": "check", "channel_id": "1", + "cron": "0 * * * *", "tool_name": "run_command", + "report_format": {"junk": True}, + }) + assert invalid_type.status == 400 + invalid_action = await c.post("/api/schedules", json={ + "description": "reminder", "action": "reminder", "channel_id": "1", + "cron": "0 * * * *", "report_format": "paginated_embed_v1", + }) + assert invalid_action.status == 400 + + async def test_unknown_format_is_400_on_create_and_update(self, tmp_path): + bot = self._real_bot(tmp_path) + async with TestClient(TestServer(_app(bot))) as c: + unknown_create = await c.post("/api/schedules", json={ + "description": "structured", "action": "check", "channel_id": "1", + "cron": "0 * * * *", "tool_name": "run_command", + "tool_input": {"command": "status"}, + "report_format": "paginated_embed_v2", + }) + assert unknown_create.status == 400 + assert "Unsupported scheduled report format" in ( + await unknown_create.json() + )["error"] + + created = await c.post("/api/schedules", json={ + "description": "plain", "action": "check", "channel_id": "1", + "cron": "0 * * * *", "tool_name": "run_command", + "tool_input": {"command": "status"}, + }) + schedule_id = (await created.json())["id"] + unknown_update = await c.put( + f"/api/schedules/{schedule_id}", + json={"report_format": "paginated_embed_v2"}, + ) + assert unknown_update.status == 400 + assert "Unsupported scheduled report format" in ( + await unknown_update.json() + )["error"] + assert "report_format" not in bot.scheduler.list_all()[0] diff --git a/ui/dist/assets/index-0WAOnBOa.js b/ui/dist/assets/index-DWXdI8DY.js similarity index 75% rename from ui/dist/assets/index-0WAOnBOa.js rename to ui/dist/assets/index-DWXdI8DY.js index 43ce8914..a1608a28 100644 --- a/ui/dist/assets/index-0WAOnBOa.js +++ b/ui/dist/assets/index-DWXdI8DY.js @@ -1,40 +1,40 @@ -var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var rt=(e,t,s)=>Km(e,typeof t!="symbol"?t+"":t,s);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function s(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=s(a);fetch(a.href,i)}})();class Wm{constructor(){this._persist=localStorage.getItem("odin_persist")==="1",this._token=this._persist?localStorage.getItem("odin_token")||"":sessionStorage.getItem("odin_token")||"";const t=this._persist?localStorage:sessionStorage;this._sessionTimeout=parseInt(t.getItem("odin_session_timeout")||"0",10),this._lastActivity=Date.now(),this._activityTimer=null,this.onSessionExpired=null,this._token&&this._sessionTimeout>0&&this._startActivityMonitor()}get token(){return this._token}get sessionTimeout(){return this._sessionTimeout}setToken(t,s=0){if(this._token=t,this._sessionTimeout=s,this._lastActivity=Date.now(),t){const n=this._persist?localStorage:sessionStorage;n.setItem("odin_token",t),this._persist&&localStorage.setItem("odin_persist","1"),s>0?n.setItem("odin_session_timeout",String(s)):n.removeItem("odin_session_timeout"),this._startActivityMonitor()}else sessionStorage.removeItem("odin_token"),sessionStorage.removeItem("odin_session_timeout"),localStorage.removeItem("odin_token"),localStorage.removeItem("odin_persist"),localStorage.removeItem("odin_session_timeout"),this._stopActivityMonitor()}setPersist(t){this._persist=t}_startActivityMonitor(){this._stopActivityMonitor(),!(this._sessionTimeout<=0)&&(this._activityTimer=setInterval(()=>{(Date.now()-this._lastActivity)/1e3>=this._sessionTimeout&&(this._stopActivityMonitor(),this.onSessionExpired&&this.onSessionExpired())},1e4))}_stopActivityMonitor(){this._activityTimer&&(clearInterval(this._activityTimer),this._activityTimer=null)}_headers(t={}){const s={"Content-Type":"application/json",...t};return this._token&&(s.Authorization=`Bearer ${this._token}`),s}async _request(t,s,n=null,{signal:a}={}){this._lastActivity=Date.now();const i={method:t,headers:this._headers(),signal:a};n!==null&&(i.body=JSON.stringify(n));const l=await fetch(s,i);if(l.status===401)throw new ol("Unauthorized");const r=await l.json().catch(()=>null);if(!l.ok){const o=(r==null?void 0:r.error)||`HTTP ${l.status}`;throw new ld(o,l.status,r)}return r}get(t,s={}){return this._request("GET",t,null,s)}async getBlob(t){this._lastActivity=Date.now();const s=await fetch(t,{method:"GET",headers:this._headers()});if(s.status===401)throw new ol("Unauthorized");if(!s.ok){const n=await s.json().catch(()=>null);throw new ld((n==null?void 0:n.error)||`HTTP ${s.status}`,s.status,n)}return s.blob()}post(t,s){return this._request("POST",t,s)}put(t,s){return this._request("PUT",t,s)}del(t){return this._request("DELETE",t)}async login(t){const s=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),n=await s.json().catch(()=>null);if(!s.ok)throw new ol((n==null?void 0:n.error)||"Login failed");return this.setToken(n.session_id,n.timeout_seconds||0),n}async logout(){try{await this.post("/api/auth/logout",{})}catch{}this.setToken("")}async check(){try{return await this.get("/api/status"),{ok:!0,needsAuth:!1}}catch(t){return t instanceof ol?{ok:!1,needsAuth:!0}:{ok:!1,needsAuth:!1,error:t.message}}}}class ol extends Error{constructor(t){super(t),this.name="AuthError"}}class ld extends Error{constructor(t,s,n){super(t),this.name="ApiError",this.status=s,this.data=n}}class Zm{constructor(t){this._api=t,this._ws=null,this._handlers={logs:[],events:[],chat:[]},this._reconnectDelay=1e3,this._maxReconnectDelay=3e4,this._shouldConnect=!1,this._subscriptions=new Set,this._reconnectAttempt=0,this._lastPongTime=0,this._pingInterval=null,this._latency=-1,this._chatPending=!1,this._state="disconnected",this.onStatusChange=null,this.onStateChange=null,this.onLatency=null}get connected(){var t;return((t=this._ws)==null?void 0:t.readyState)===WebSocket.OPEN}get state(){return this._state}get reconnectAttempt(){return this._reconnectAttempt}get latency(){return this._latency}_resetLatency(){if(this._latency=-1,this.onLatency)try{this.onLatency(-1)}catch{}}connect(){this._shouldConnect=!0,this._setState("connecting"),this._open()}disconnect(){this._shouldConnect=!1,this._reconnectAttempt=0,this._resetLatency(),this._stopPing(),this._ws&&(this._ws.close(),this._ws=null),this._setState("disconnected")}_setState(t){this._state!==t&&(this._state=t,this.onStateChange&&this.onStateChange(t,{attempt:this._reconnectAttempt,latency:this._latency}))}_startPing(){this._stopPing(),this._pingInterval=setInterval(()=>{if(this.connected)try{this._ws.send(JSON.stringify({type:"ping",ts:Date.now()}))}catch{}},15e3)}_stopPing(){this._pingInterval&&(clearInterval(this._pingInterval),this._pingInterval=null)}subscribe(t,s){this._handlers[t]||(this._handlers[t]=[]),this._handlers[t].push(s),t!=="chat"&&(this._subscriptions.add(t),this.connected&&this._ws.send(JSON.stringify({subscribe:t})))}unsubscribe(t,s){const n=this._handlers[t];if(n){const a=n.indexOf(s);a>=0&&n.splice(a,1),n.length===0&&t!=="chat"&&(this._subscriptions.delete(t),this.connected&&this._ws.send(JSON.stringify({unsubscribe:t})))}}on(t,s){return this.subscribe(t,s)}off(t,s){return this.unsubscribe(t,s)}sendChat(t,{channelId:s,userId:n,username:a}={}){return this.connected?(this._ws.send(JSON.stringify({type:"chat",content:t,channel_id:s||"web-default",user_id:n||void 0,username:a||void 0})),this._chatPending=!0,!0):!1}_open(){if(this._ws)return;let s=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws`;this._api.token&&(s+=`?token=${encodeURIComponent(this._api.token)}`);const n=new WebSocket(s);this._ws=n;const a=()=>this._ws===n;n.onopen=()=>{if(a()){this._reconnectDelay=1e3,this._reconnectAttempt=0;for(const i of this._subscriptions)n.send(JSON.stringify({subscribe:i}));this._startPing(),this._setState("connected"),this.onStatusChange&&this.onStatusChange(!0)}},n.onmessage=i=>{if(!a())return;let l;try{l=JSON.parse(i.data)}catch{return}const r=l.type;if(r==="pong"){if(l.ts&&(this._latency=Date.now()-l.ts,this._lastPongTime=Date.now(),this.onLatency))try{this.onLatency(this._latency)}catch{}return}if(r==="log")for(const o of this._handlers.logs||[])o(l);else if(r==="event")for(const o of this._handlers.events||[])o(l);else if(r==="chat_response"||r==="chat_error"){this._chatPending=!1;for(const o of this._handlers.chat||[])o(l)}},n.onclose=()=>{if(a()){if(this._ws=null,this._stopPing(),this._resetLatency(),this._chatPending){this._chatPending=!1;const i={type:"chat_error",error:"Connection lost — the response may still complete; check session history."};for(const l of this._handlers.chat||[])l(i)}this.onStatusChange&&this.onStatusChange(!1),this._shouldConnect?(this._reconnectAttempt++,this._setState("reconnecting"),setTimeout(()=>this._open(),this._reconnectDelay),this._reconnectDelay=Math.min(this._reconnectDelay*2,this._maxReconnectDelay)):this._setState("disconnected")}},n.onerror=()=>{}}}const G=new Wm,Ke=new Zm(G);/** +var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var rt=(e,t,s)=>Km(e,typeof t!="symbol"?t+"":t,s);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function s(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=s(a);fetch(a.href,i)}})();class Wm{constructor(){this._persist=localStorage.getItem("odin_persist")==="1",this._token=this._persist?localStorage.getItem("odin_token")||"":sessionStorage.getItem("odin_token")||"";const t=this._persist?localStorage:sessionStorage;this._sessionTimeout=parseInt(t.getItem("odin_session_timeout")||"0",10),this._lastActivity=Date.now(),this._activityTimer=null,this.onSessionExpired=null,this._token&&this._sessionTimeout>0&&this._startActivityMonitor()}get token(){return this._token}get sessionTimeout(){return this._sessionTimeout}setToken(t,s=0){if(this._token=t,this._sessionTimeout=s,this._lastActivity=Date.now(),t){const n=this._persist?localStorage:sessionStorage;n.setItem("odin_token",t),this._persist&&localStorage.setItem("odin_persist","1"),s>0?n.setItem("odin_session_timeout",String(s)):n.removeItem("odin_session_timeout"),this._startActivityMonitor()}else sessionStorage.removeItem("odin_token"),sessionStorage.removeItem("odin_session_timeout"),localStorage.removeItem("odin_token"),localStorage.removeItem("odin_persist"),localStorage.removeItem("odin_session_timeout"),this._stopActivityMonitor()}setPersist(t){this._persist=t}_startActivityMonitor(){this._stopActivityMonitor(),!(this._sessionTimeout<=0)&&(this._activityTimer=setInterval(()=>{(Date.now()-this._lastActivity)/1e3>=this._sessionTimeout&&(this._stopActivityMonitor(),this.onSessionExpired&&this.onSessionExpired())},1e4))}_stopActivityMonitor(){this._activityTimer&&(clearInterval(this._activityTimer),this._activityTimer=null)}_headers(t={}){const s={"Content-Type":"application/json",...t};return this._token&&(s.Authorization=`Bearer ${this._token}`),s}async _request(t,s,n=null,{signal:a}={}){this._lastActivity=Date.now();const i={method:t,headers:this._headers(),signal:a};n!==null&&(i.body=JSON.stringify(n));const l=await fetch(s,i);if(l.status===401)throw new ol("Unauthorized");const r=await l.json().catch(()=>null);if(!l.ok){const o=(r==null?void 0:r.error)||`HTTP ${l.status}`;throw new ld(o,l.status,r)}return r}get(t,s={}){return this._request("GET",t,null,s)}async getBlob(t){this._lastActivity=Date.now();const s=await fetch(t,{method:"GET",headers:this._headers()});if(s.status===401)throw new ol("Unauthorized");if(!s.ok){const n=await s.json().catch(()=>null);throw new ld((n==null?void 0:n.error)||`HTTP ${s.status}`,s.status,n)}return s.blob()}post(t,s){return this._request("POST",t,s)}put(t,s){return this._request("PUT",t,s)}del(t){return this._request("DELETE",t)}async login(t){const s=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),n=await s.json().catch(()=>null);if(!s.ok)throw new ol((n==null?void 0:n.error)||"Login failed");return this.setToken(n.session_id,n.timeout_seconds||0),n}async logout(){try{await this.post("/api/auth/logout",{})}catch{}this.setToken("")}async check(){try{return await this.get("/api/status"),{ok:!0,needsAuth:!1}}catch(t){return t instanceof ol?{ok:!1,needsAuth:!0}:{ok:!1,needsAuth:!1,error:t.message}}}}class ol extends Error{constructor(t){super(t),this.name="AuthError"}}class ld extends Error{constructor(t,s,n){super(t),this.name="ApiError",this.status=s,this.data=n}}class Zm{constructor(t){this._api=t,this._ws=null,this._handlers={logs:[],events:[],chat:[]},this._reconnectDelay=1e3,this._maxReconnectDelay=3e4,this._shouldConnect=!1,this._subscriptions=new Set,this._reconnectAttempt=0,this._lastPongTime=0,this._pingInterval=null,this._latency=-1,this._chatPending=!1,this._state="disconnected",this.onStatusChange=null,this.onStateChange=null,this.onLatency=null}get connected(){var t;return((t=this._ws)==null?void 0:t.readyState)===WebSocket.OPEN}get state(){return this._state}get reconnectAttempt(){return this._reconnectAttempt}get latency(){return this._latency}_resetLatency(){if(this._latency=-1,this.onLatency)try{this.onLatency(-1)}catch{}}connect(){this._shouldConnect=!0,this._setState("connecting"),this._open()}disconnect(){this._shouldConnect=!1,this._reconnectAttempt=0,this._resetLatency(),this._stopPing(),this._ws&&(this._ws.close(),this._ws=null),this._setState("disconnected")}_setState(t){this._state!==t&&(this._state=t,this.onStateChange&&this.onStateChange(t,{attempt:this._reconnectAttempt,latency:this._latency}))}_startPing(){this._stopPing(),this._pingInterval=setInterval(()=>{if(this.connected)try{this._ws.send(JSON.stringify({type:"ping",ts:Date.now()}))}catch{}},15e3)}_stopPing(){this._pingInterval&&(clearInterval(this._pingInterval),this._pingInterval=null)}subscribe(t,s){this._handlers[t]||(this._handlers[t]=[]),this._handlers[t].push(s),t!=="chat"&&(this._subscriptions.add(t),this.connected&&this._ws.send(JSON.stringify({subscribe:t})))}unsubscribe(t,s){const n=this._handlers[t];if(n){const a=n.indexOf(s);a>=0&&n.splice(a,1),n.length===0&&t!=="chat"&&(this._subscriptions.delete(t),this.connected&&this._ws.send(JSON.stringify({unsubscribe:t})))}}on(t,s){return this.subscribe(t,s)}off(t,s){return this.unsubscribe(t,s)}sendChat(t,{channelId:s,userId:n,username:a}={}){return this.connected?(this._ws.send(JSON.stringify({type:"chat",content:t,channel_id:s||"web-default",user_id:n||void 0,username:a||void 0})),this._chatPending=!0,!0):!1}_open(){if(this._ws)return;let s=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws`;this._api.token&&(s+=`?token=${encodeURIComponent(this._api.token)}`);const n=new WebSocket(s);this._ws=n;const a=()=>this._ws===n;n.onopen=()=>{if(a()){this._reconnectDelay=1e3,this._reconnectAttempt=0;for(const i of this._subscriptions)n.send(JSON.stringify({subscribe:i}));this._startPing(),this._setState("connected"),this.onStatusChange&&this.onStatusChange(!0)}},n.onmessage=i=>{if(!a())return;let l;try{l=JSON.parse(i.data)}catch{return}const r=l.type;if(r==="pong"){if(l.ts&&(this._latency=Date.now()-l.ts,this._lastPongTime=Date.now(),this.onLatency))try{this.onLatency(this._latency)}catch{}return}if(r==="log")for(const o of this._handlers.logs||[])o(l);else if(r==="event")for(const o of this._handlers.events||[])o(l);else if(r==="chat_response"||r==="chat_error"){this._chatPending=!1;for(const o of this._handlers.chat||[])o(l)}},n.onclose=()=>{if(a()){if(this._ws=null,this._stopPing(),this._resetLatency(),this._chatPending){this._chatPending=!1;const i={type:"chat_error",error:"Connection lost — the response may still complete; check session history."};for(const l of this._handlers.chat||[])l(i)}this.onStatusChange&&this.onStatusChange(!1),this._shouldConnect?(this._reconnectAttempt++,this._setState("reconnecting"),setTimeout(()=>this._open(),this._reconnectDelay),this._reconnectDelay=Math.min(this._reconnectDelay*2,this._maxReconnectDelay)):this._setState("disconnected")}},n.onerror=()=>{}}}const q=new Wm,Ke=new Zm(q);/** * @vue/shared v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function ks(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const je={},Na=[],Ht=()=>{},Ia=()=>!1,ca=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cr=e=>e.startsWith("onUpdate:"),ze=Object.assign,Jo=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Jm=Object.prototype.hasOwnProperty,tt=(e,t)=>Jm.call(e,t),be=Array.isArray,La=e=>ei(e)==="[object Map]",da=e=>ei(e)==="[object Set]",rd=e=>ei(e)==="[object Date]",Ym=e=>ei(e)==="[object RegExp]",Ie=e=>typeof e=="function",Me=e=>typeof e=="string",Jt=e=>typeof e=="symbol",Xe=e=>e!==null&&typeof e=="object",Yo=e=>(Xe(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),df=Object.prototype.toString,ei=e=>df.call(e),Qm=e=>ei(e).slice(8,-1),dr=e=>ei(e)==="[object Object]",ur=e=>Me(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bn=ks(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Xm=ks("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),fr=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},eg=/-\w/g,it=fr(e=>e.replace(eg,t=>t.slice(1).toUpperCase())),tg=/\B([A-Z])/g,ps=fr(e=>e.replace(tg,"-$1").toLowerCase()),ua=fr(e=>e.charAt(0).toUpperCase()+e.slice(1)),Da=fr(e=>e?`on${ua(e)}`:""),Lt=(e,t)=>!Object.is(e,t),Ma=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},pr=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ll=e=>{const t=Me(e)?Number(e):NaN;return isNaN(t)?e:t};let od;const hr=()=>od||(od=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function sg(e,t){return e+JSON.stringify(t,(s,n)=>typeof n=="function"?n.toString():n)}const ng="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",ag=ks(ng);function Ji(e){if(be(e)){const t={};for(let s=0;s{if(s){const n=s.split(lg);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Yi(e){let t="";if(Me(e))t=e;else if(be(e))for(let s=0;skn(s,t))}const hf=e=>!!(e&&e.__v_isRef===!0),mf=e=>Me(e)?e:e==null?"":be(e)||Xe(e)&&(e.toString===df||!Ie(e.toString))?hf(e)?mf(e.value):JSON.stringify(e,gf,2):String(e),gf=(e,t)=>hf(t)?gf(e,t.value):La(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,a],i)=>(s[Ur(n,i)+" =>"]=a,s),{})}:da(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Ur(s))}:Jt(t)?Ur(t):Xe(t)&&!be(t)&&!dr(t)?String(t):t,Ur=(e,t="")=>{var s;return Jt(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};function xg(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** +**/function ks(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const je={},Na=[],Ht=()=>{},Ia=()=>!1,ca=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cr=e=>e.startsWith("onUpdate:"),ze=Object.assign,Jo=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Jm=Object.prototype.hasOwnProperty,tt=(e,t)=>Jm.call(e,t),ye=Array.isArray,La=e=>ei(e)==="[object Map]",da=e=>ei(e)==="[object Set]",rd=e=>ei(e)==="[object Date]",Ym=e=>ei(e)==="[object RegExp]",Ie=e=>typeof e=="function",Me=e=>typeof e=="string",Jt=e=>typeof e=="symbol",Xe=e=>e!==null&&typeof e=="object",Yo=e=>(Xe(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),cp=Object.prototype.toString,ei=e=>cp.call(e),Qm=e=>ei(e).slice(8,-1),dr=e=>ei(e)==="[object Object]",ur=e=>Me(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bn=ks(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Xm=ks("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),pr=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},eg=/-\w/g,it=pr(e=>e.replace(eg,t=>t.slice(1).toUpperCase())),tg=/\B([A-Z])/g,fs=pr(e=>e.replace(tg,"-$1").toLowerCase()),ua=pr(e=>e.charAt(0).toUpperCase()+e.slice(1)),Da=pr(e=>e?`on${ua(e)}`:""),Lt=(e,t)=>!Object.is(e,t),Ma=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},fr=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ll=e=>{const t=Me(e)?Number(e):NaN;return isNaN(t)?e:t};let od;const hr=()=>od||(od=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function sg(e,t){return e+JSON.stringify(t,(s,n)=>typeof n=="function"?n.toString():n)}const ng="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",ag=ks(ng);function Ji(e){if(ye(e)){const t={};for(let s=0;s{if(s){const n=s.split(lg);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Yi(e){let t="";if(Me(e))t=e;else if(ye(e))for(let s=0;skn(s,t))}const fp=e=>!!(e&&e.__v_isRef===!0),hp=e=>Me(e)?e:e==null?"":ye(e)||Xe(e)&&(e.toString===cp||!Ie(e.toString))?fp(e)?hp(e.value):JSON.stringify(e,mp,2):String(e),mp=(e,t)=>fp(t)?mp(e,t.value):La(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,a],i)=>(s[Br(n,i)+" =>"]=a,s),{})}:da(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Br(s))}:Jt(t)?Br(t):Xe(t)&&!ye(t)&&!dr(t)?String(t):t,Br=(e,t="")=>{var s;return Jt(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};function xg(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** * @vue/reactivity v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let At;class Qo{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&At&&(At.active?(this.parent=At,this.index=(At.scopes||(At.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t0&&--this._on===0){if(At===this)At=this.prevScope;else{let t=At;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s0)return;if(ki){let t=ki;for(ki=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;_i;){let t=_i;for(_i=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function xf(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _f(e){let t,s=e.depsTail,n=s;for(;n;){const a=n.prevDep;n.version===-1?(n===s&&(s=a),tc(n),wg(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=a}e.deps=t,e.depsTail=s}function mo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(kf(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function kf(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Li)||(e.globalVersion=Li,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!mo(e))))return;e.flags|=2;const t=e.dep,s=ot,n=zs;ot=e,zs=!0;try{xf(e);const a=e.fn(e._value);(t.version===0||Lt(a,e._value))&&(e.flags|=128,e._value=a,t.version++)}catch(a){throw t.version++,a}finally{ot=s,zs=n,_f(e),e.flags&=-3}}function tc(e,t=!1){const{dep:s,prevSub:n,nextSub:a}=e;if(n&&(n.nextSub=a,e.prevSub=void 0),a&&(a.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)tc(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function wg(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}function Sg(e,t){e.effect instanceof Ni&&(e=e.effect.fn);const s=new Ni(e);t&&ze(s,t);try{s.run()}catch(a){throw s.stop(),a}const n=s.run.bind(s);return n.effect=s,n}function Tg(e){e.effect.stop()}let zs=!0;const wf=[];function wn(){wf.push(zs),zs=!1}function Sn(){const e=wf.pop();zs=e===void 0?!0:e}function cd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ot;ot=void 0;try{t()}finally{ot=s}}}let Li=0;class Cg{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gr{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ot||!zs||ot===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ot)s=this.activeLink=new Cg(ot,this),ot.deps?(s.prevDep=ot.depsTail,ot.depsTail.nextDep=s,ot.depsTail=s):ot.deps=ot.depsTail=s,Sf(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ot.depsTail,s.nextDep=void 0,ot.depsTail.nextDep=s,ot.depsTail=s,ot.deps===s&&(ot.deps=n)}return s}trigger(t){this.version++,Li++,this.notify(t)}notify(t){Xo();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{ec()}}}function Sf(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Sf(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Dl=new WeakMap,ea=Symbol(""),go=Symbol(""),Di=Symbol("");function Kt(e,t,s){if(zs&&ot){let n=Dl.get(e);n||Dl.set(e,n=new Map);let a=n.get(s);a||(n.set(s,a=new gr),a.map=n,a.key=s),a.track()}}function pn(e,t,s,n,a,i){const l=Dl.get(e);if(!l){Li++;return}const r=o=>{o&&o.trigger()};if(Xo(),t==="clear")l.forEach(r);else{const o=be(e),c=o&&ur(s);if(o&&s==="length"){const d=Number(n);l.forEach((u,f)=>{(f==="length"||f===Di||!Jt(f)&&f>=d)&&r(u)})}else switch((s!==void 0||l.has(void 0))&&r(l.get(s)),c&&r(l.get(Di)),t){case"add":o?c&&r(l.get("length")):(r(l.get(ea)),La(e)&&r(l.get(go)));break;case"delete":o||(r(l.get(ea)),La(e)&&r(l.get(go)));break;case"set":La(e)&&r(l.get(ea));break}}ec()}function Eg(e,t){const s=Dl.get(e);return s&&s.get(t)}function xa(e){const t=Je(e);return t===e?t:(Kt(t,"iterate",Di),ms(e)?t:t.map(js))}function vr(e){return Kt(e=Je(e),"iterate",Di),e}function Xs(e,t){return tn(e)?za(yn(e)?js(t):t):js(t)}const Ag={__proto__:null,[Symbol.iterator](){return zr(this,Symbol.iterator,e=>Xs(this,e))},concat(...e){return xa(this).concat(...e.map(t=>be(t)?xa(t):t))},entries(){return zr(this,"entries",e=>(e[1]=Xs(this,e[1]),e))},every(e,t){return an(this,"every",e,t,void 0,arguments)},filter(e,t){return an(this,"filter",e,t,s=>s.map(n=>Xs(this,n)),arguments)},find(e,t){return an(this,"find",e,t,s=>Xs(this,s),arguments)},findIndex(e,t){return an(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return an(this,"findLast",e,t,s=>Xs(this,s),arguments)},findLastIndex(e,t){return an(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return an(this,"forEach",e,t,void 0,arguments)},includes(...e){return Vr(this,"includes",e)},indexOf(...e){return Vr(this,"indexOf",e)},join(e){return xa(this).join(e)},lastIndexOf(...e){return Vr(this,"lastIndexOf",e)},map(e,t){return an(this,"map",e,t,void 0,arguments)},pop(){return ri(this,"pop")},push(...e){return ri(this,"push",e)},reduce(e,...t){return dd(this,"reduce",e,t)},reduceRight(e,...t){return dd(this,"reduceRight",e,t)},shift(){return ri(this,"shift")},some(e,t){return an(this,"some",e,t,void 0,arguments)},splice(...e){return ri(this,"splice",e)},toReversed(){return xa(this).toReversed()},toSorted(e){return xa(this).toSorted(e)},toSpliced(...e){return xa(this).toSpliced(...e)},unshift(...e){return ri(this,"unshift",e)},values(){return zr(this,"values",e=>Xs(this,e))}};function zr(e,t,s){const n=vr(e),a=n[t]();return n!==e&&!ms(e)&&(a._next=a.next,a.next=()=>{const i=a._next();return i.done||(i.value=s(i.value)),i}),a}const Rg=Array.prototype;function an(e,t,s,n,a,i){const l=vr(e),r=l!==e&&!ms(e),o=l[t];if(o!==Rg[t]){const u=o.apply(e,i);return r?js(u):u}let c=s;l!==e&&(r?c=function(u,f){return s.call(this,Xs(e,u),f,e)}:s.length>2&&(c=function(u,f){return s.call(this,u,f,e)}));const d=o.call(l,c,n);return r&&a?a(d):d}function dd(e,t,s,n){const a=vr(e),i=a!==e&&!ms(e);let l=s,r=!1;a!==e&&(i?(r=n.length===0,l=function(c,d,u){return r&&(r=!1,c=Xs(e,c)),s.call(this,c,Xs(e,d),u,e)}):s.length>3&&(l=function(c,d,u){return s.call(this,c,d,u,e)}));const o=a[t](l,...n);return r?Xs(e,o):o}function Vr(e,t,s){const n=Je(e);Kt(n,"iterate",Di);const a=n[t](...s);return(a===-1||a===!1)&&Qi(s[0])?(s[0]=Je(s[0]),n[t](...s)):a}function ri(e,t,s=[]){wn(),Xo();const n=Je(e)[t].apply(e,s);return ec(),Sn(),n}const Ig=ks("__proto__,__v_isRef,__isVue"),Tf=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Jt));function Og(e){Jt(e)||(e=String(e));const t=Je(this);return Kt(t,"has",e),t.hasOwnProperty(e)}class Cf{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const a=this._isReadonly,i=this._isShallow;if(s==="__v_isReactive")return!a;if(s==="__v_isReadonly")return a;if(s==="__v_isShallow")return i;if(s==="__v_raw")return n===(a?i?Nf:Of:i?If:Rf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=be(t);if(!a){let o;if(l&&(o=Ag[s]))return o;if(s==="hasOwnProperty")return Og}const r=Reflect.get(t,s,St(t)?t:n);if((Jt(s)?Tf.has(s):Ig(s))||(a||Kt(t,"get",s),i))return r;if(St(r)){const o=l&&ur(s)?r:r.value;return a&&Xe(o)?Ml(o):o}return Xe(r)?a?Ml(r):Hn(r):r}}class Ef extends Cf{constructor(t=!1){super(!1,t)}set(t,s,n,a){let i=t[s];const l=be(t)&&ur(s);if(!this._isShallow){const c=tn(i);if(!ms(n)&&!tn(n)&&(i=Je(i),n=Je(n)),!l&&St(i)&&!St(n))return c||(i.value=n),!0}const r=l?Number(s)e,cl=e=>Reflect.getPrototypeOf(e);function Pg(e,t,s){return function(...n){const a=this.__v_raw,i=Je(a),l=La(i),r=e==="entries"||e===Symbol.iterator&&l,o=e==="keys"&&l,c=a[e](...n),d=s?vo:t?za:js;return!t&&Kt(i,"iterate",o?go:ea),ze(Object.create(c),{next(){const{value:u,done:f}=c.next();return f?{value:u,done:f}:{value:r?[d(u[0]),d(u[1])]:d(u),done:f}}})}}function dl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Fg(e,t){const s={get(a){const i=this.__v_raw,l=Je(i),r=Je(a);e||(Lt(a,r)&&Kt(l,"get",a),Kt(l,"get",r));const{has:o}=cl(l),c=t?vo:e?za:js;if(o.call(l,a))return c(i.get(a));if(o.call(l,r))return c(i.get(r));i!==l&&i.get(a)},get size(){const a=this.__v_raw;return!e&&Kt(Je(a),"iterate",ea),a.size},has(a){const i=this.__v_raw,l=Je(i),r=Je(a);return e||(Lt(a,r)&&Kt(l,"has",a),Kt(l,"has",r)),a===r?i.has(a):i.has(a)||i.has(r)},forEach(a,i){const l=this,r=l.__v_raw,o=Je(r),c=t?vo:e?za:js;return!e&&Kt(o,"iterate",ea),r.forEach((d,u)=>a.call(i,c(d),c(u),l))}};return ze(s,e?{add:dl("add"),set:dl("set"),delete:dl("delete"),clear:dl("clear")}:{add(a){const i=Je(this),l=cl(i),r=Je(a),o=!t&&!ms(a)&&!tn(a)?r:a;return l.has.call(i,o)||Lt(a,o)&&l.has.call(i,a)||Lt(r,o)&&l.has.call(i,r)||(i.add(o),pn(i,"add",o,o)),this},set(a,i){!t&&!ms(i)&&!tn(i)&&(i=Je(i));const l=Je(this),{has:r,get:o}=cl(l);let c=r.call(l,a);c||(a=Je(a),c=r.call(l,a));const d=o.call(l,a);return l.set(a,i),c?Lt(i,d)&&pn(l,"set",a,i):pn(l,"add",a,i),this},delete(a){const i=Je(this),{has:l,get:r}=cl(i);let o=l.call(i,a);o||(a=Je(a),o=l.call(i,a)),r&&r.call(i,a);const c=i.delete(a);return o&&pn(i,"delete",a,void 0),c},clear(){const a=Je(this),i=a.size!==0,l=a.clear();return i&&pn(a,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(a=>{s[a]=Pg(a,e,t)}),s}function br(e,t){const s=Fg(e,t);return(n,a,i)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?n:Reflect.get(tt(s,a)&&a in n?s:n,a,i)}const $g={get:br(!1,!1)},Bg={get:br(!1,!0)},Ug={get:br(!0,!1)},Hg={get:br(!0,!0)},Rf=new WeakMap,If=new WeakMap,Of=new WeakMap,Nf=new WeakMap;function zg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Hn(e){return tn(e)?e:yr(e,!1,Ng,$g,Rf)}function sc(e){return yr(e,!1,Dg,Bg,If)}function Ml(e){return yr(e,!0,Lg,Ug,Of)}function Vg(e){return yr(e,!0,Mg,Hg,Nf)}function yr(e,t,s,n,a){if(!Xe(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=a.get(e);if(i)return i;const l=zg(Qm(e));if(l===0)return e;const r=new Proxy(e,l===2?n:s);return a.set(e,r),r}function yn(e){return tn(e)?yn(e.__v_raw):!!(e&&e.__v_isReactive)}function tn(e){return!!(e&&e.__v_isReadonly)}function ms(e){return!!(e&&e.__v_isShallow)}function Qi(e){return e?!!e.__v_raw:!1}function Je(e){const t=e&&e.__v_raw;return t?Je(t):e}function Lf(e){return!tt(e,"__v_skip")&&Object.isExtensible(e)&&uf(e,"__v_skip",!0),e}const js=e=>Xe(e)?Hn(e):e,za=e=>Xe(e)?Ml(e):e;function St(e){return e?e.__v_isRef===!0:!1}function h(e){return Df(e,!1)}function nc(e){return Df(e,!0)}function Df(e,t){return St(e)?e:new jg(e,t)}class jg{constructor(t,s){this.dep=new gr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:Je(t),this._value=s?t:js(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||ms(t)||tn(t);t=n?t:Je(t),Lt(t,s)&&(this._rawValue=t,this._value=n?t:js(t),this.dep.trigger())}}function qg(e){e.dep&&e.dep.trigger()}function en(e){return St(e)?e.value:e}function Gg(e){return Ie(e)?e():en(e)}const Kg={get:(e,t,s)=>t==="__v_raw"?e:en(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const a=e[t];return St(a)&&!St(s)?(a.value=s,!0):Reflect.set(e,t,s,n)}};function ac(e){return yn(e)?e:new Proxy(e,Kg)}class Wg{constructor(t){this.__v_isRef=!0,this._value=void 0;const s=this.dep=new gr,{get:n,set:a}=t(s.track.bind(s),s.trigger.bind(s));this._get=n,this._set=a}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Mf(e){return new Wg(e)}function Zg(e){const t=be(e)?new Array(e.length):{};for(const s in e)t[s]=Pf(e,s);return t}class Jg{constructor(t,s,n){this._object=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=Jt(s)?s:String(s),this._raw=Je(t);let a=!0,i=t;if(!be(t)||Jt(this._key)||!ur(this._key))do a=!Qi(i)||ms(i);while(a&&(i=i.__v_raw));this._shallow=a}get value(){let t=this._object[this._key];return this._shallow&&(t=en(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&St(this._raw[this._key])){const s=this._object[this._key];if(St(s)){s.value=t;return}}this._object[this._key]=t}get dep(){return Eg(this._raw,this._key)}}class Yg{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Qg(e,t,s){return St(e)?e:Ie(e)?new Yg(e):Xe(e)&&arguments.length>1?Pf(e,t,s):h(e)}function Pf(e,t,s){return new Jg(e,t,s)}class Xg{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new gr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Li-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ot!==this)return yf(this,!0),!0}get value(){const t=this.dep.track();return kf(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ev(e,t,s=!1){let n,a;return Ie(e)?n=e:(n=e.get,a=e.set),new Xg(n,a,s)}const tv={GET:"get",HAS:"has",ITERATE:"iterate"},sv={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},ul={},Pl=new WeakMap;let Dn;function nv(){return Dn}function Ff(e,t=!1,s=Dn){if(s){let n=Pl.get(s);n||Pl.set(s,n=[]),n.push(e)}}function av(e,t,s=je){const{immediate:n,deep:a,once:i,scheduler:l,augmentJob:r,call:o}=s,c=_=>a?_:ms(_)||a===!1||a===0?hn(_,1):hn(_);let d,u,f,p,b=!1,y=!1;if(St(e)?(u=()=>e.value,b=ms(e)):yn(e)?(u=()=>c(e),b=!0):be(e)?(y=!0,b=e.some(_=>yn(_)||ms(_)),u=()=>e.map(_=>{if(St(_))return _.value;if(yn(_))return c(_);if(Ie(_))return o?o(_,2):_()})):Ie(e)?t?u=o?()=>o(e,2):e:u=()=>{if(f){wn();try{f()}finally{Sn()}}const _=Dn;Dn=d;try{return o?o(e,3,[p]):e(p)}finally{Dn=_}}:u=Ht,t&&a){const _=u,S=a===!0?1/0:a;u=()=>hn(_(),S)}const E=vf(),I=()=>{d.stop(),E&&E.active&&Jo(E.effects,d)};if(i&&t){const _=t;t=(...S)=>{const g=_(...S);return I(),g}}let x=y?new Array(e.length).fill(ul):ul;const m=_=>{if(!(!(d.flags&1)||!d.dirty&&!_))if(t){const S=d.run();if(_||a||b||(y?S.some((g,w)=>Lt(g,x[w])):Lt(S,x))){f&&f();const g=Dn;Dn=d;try{const w=[S,x===ul?void 0:y&&x[0]===ul?[]:x,p];x=S,o?o(t,3,w):t(...w)}finally{Dn=g}}}else d.run()};return r&&r(m),d=new Ni(u),d.scheduler=l?()=>l(m,!1):m,p=_=>Ff(_,!1,d),f=d.onStop=()=>{const _=Pl.get(d);if(_){if(o)o(_,4);else for(const S of _)S();Pl.delete(d)}},t?n?m(!0):x=d.run():l?l(m.bind(null,!0),!0):d.run(),I.pause=d.pause.bind(d),I.resume=d.resume.bind(d),I.stop=I,I}function hn(e,t=1/0,s){if(t<=0||!Xe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,St(e))hn(e.value,t,s);else if(be(e))for(let n=0;n{hn(n,t,s)});else if(dr(e)){for(const n in e)hn(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&hn(e[n],t,s)}return e}/** +**/let At;class Qo{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&At&&(At.active?(this.parent=At,this.index=(At.scopes||(At.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t0&&--this._on===0){if(At===this)At=this.prevScope;else{let t=At;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s0)return;if(ki){let t=ki;for(ki=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;_i;){let t=_i;for(_i=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function yp(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xp(e){let t,s=e.depsTail,n=s;for(;n;){const a=n.prevDep;n.version===-1?(n===s&&(s=a),tc(n),wg(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=a}e.deps=t,e.depsTail=s}function mo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_p(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _p(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Li)||(e.globalVersion=Li,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!mo(e))))return;e.flags|=2;const t=e.dep,s=ot,n=zs;ot=e,zs=!0;try{yp(e);const a=e.fn(e._value);(t.version===0||Lt(a,e._value))&&(e.flags|=128,e._value=a,t.version++)}catch(a){throw t.version++,a}finally{ot=s,zs=n,xp(e),e.flags&=-3}}function tc(e,t=!1){const{dep:s,prevSub:n,nextSub:a}=e;if(n&&(n.nextSub=a,e.prevSub=void 0),a&&(a.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)tc(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function wg(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}function Sg(e,t){e.effect instanceof Ni&&(e=e.effect.fn);const s=new Ni(e);t&&ze(s,t);try{s.run()}catch(a){throw s.stop(),a}const n=s.run.bind(s);return n.effect=s,n}function Tg(e){e.effect.stop()}let zs=!0;const kp=[];function wn(){kp.push(zs),zs=!1}function Sn(){const e=kp.pop();zs=e===void 0?!0:e}function cd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ot;ot=void 0;try{t()}finally{ot=s}}}let Li=0;class Cg{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gr{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ot||!zs||ot===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ot)s=this.activeLink=new Cg(ot,this),ot.deps?(s.prevDep=ot.depsTail,ot.depsTail.nextDep=s,ot.depsTail=s):ot.deps=ot.depsTail=s,wp(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ot.depsTail,s.nextDep=void 0,ot.depsTail.nextDep=s,ot.depsTail=s,ot.deps===s&&(ot.deps=n)}return s}trigger(t){this.version++,Li++,this.notify(t)}notify(t){Xo();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{ec()}}}function wp(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)wp(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Dl=new WeakMap,ea=Symbol(""),go=Symbol(""),Di=Symbol("");function Kt(e,t,s){if(zs&&ot){let n=Dl.get(e);n||Dl.set(e,n=new Map);let a=n.get(s);a||(n.set(s,a=new gr),a.map=n,a.key=s),a.track()}}function fn(e,t,s,n,a,i){const l=Dl.get(e);if(!l){Li++;return}const r=o=>{o&&o.trigger()};if(Xo(),t==="clear")l.forEach(r);else{const o=ye(e),c=o&&ur(s);if(o&&s==="length"){const d=Number(n);l.forEach((u,p)=>{(p==="length"||p===Di||!Jt(p)&&p>=d)&&r(u)})}else switch((s!==void 0||l.has(void 0))&&r(l.get(s)),c&&r(l.get(Di)),t){case"add":o?c&&r(l.get("length")):(r(l.get(ea)),La(e)&&r(l.get(go)));break;case"delete":o||(r(l.get(ea)),La(e)&&r(l.get(go)));break;case"set":La(e)&&r(l.get(ea));break}}ec()}function Eg(e,t){const s=Dl.get(e);return s&&s.get(t)}function xa(e){const t=Je(e);return t===e?t:(Kt(t,"iterate",Di),ms(e)?t:t.map(js))}function vr(e){return Kt(e=Je(e),"iterate",Di),e}function Xs(e,t){return tn(e)?za(yn(e)?js(t):t):js(t)}const Ag={__proto__:null,[Symbol.iterator](){return zr(this,Symbol.iterator,e=>Xs(this,e))},concat(...e){return xa(this).concat(...e.map(t=>ye(t)?xa(t):t))},entries(){return zr(this,"entries",e=>(e[1]=Xs(this,e[1]),e))},every(e,t){return an(this,"every",e,t,void 0,arguments)},filter(e,t){return an(this,"filter",e,t,s=>s.map(n=>Xs(this,n)),arguments)},find(e,t){return an(this,"find",e,t,s=>Xs(this,s),arguments)},findIndex(e,t){return an(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return an(this,"findLast",e,t,s=>Xs(this,s),arguments)},findLastIndex(e,t){return an(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return an(this,"forEach",e,t,void 0,arguments)},includes(...e){return Vr(this,"includes",e)},indexOf(...e){return Vr(this,"indexOf",e)},join(e){return xa(this).join(e)},lastIndexOf(...e){return Vr(this,"lastIndexOf",e)},map(e,t){return an(this,"map",e,t,void 0,arguments)},pop(){return ri(this,"pop")},push(...e){return ri(this,"push",e)},reduce(e,...t){return dd(this,"reduce",e,t)},reduceRight(e,...t){return dd(this,"reduceRight",e,t)},shift(){return ri(this,"shift")},some(e,t){return an(this,"some",e,t,void 0,arguments)},splice(...e){return ri(this,"splice",e)},toReversed(){return xa(this).toReversed()},toSorted(e){return xa(this).toSorted(e)},toSpliced(...e){return xa(this).toSpliced(...e)},unshift(...e){return ri(this,"unshift",e)},values(){return zr(this,"values",e=>Xs(this,e))}};function zr(e,t,s){const n=vr(e),a=n[t]();return n!==e&&!ms(e)&&(a._next=a.next,a.next=()=>{const i=a._next();return i.done||(i.value=s(i.value)),i}),a}const Rg=Array.prototype;function an(e,t,s,n,a,i){const l=vr(e),r=l!==e&&!ms(e),o=l[t];if(o!==Rg[t]){const u=o.apply(e,i);return r?js(u):u}let c=s;l!==e&&(r?c=function(u,p){return s.call(this,Xs(e,u),p,e)}:s.length>2&&(c=function(u,p){return s.call(this,u,p,e)}));const d=o.call(l,c,n);return r&&a?a(d):d}function dd(e,t,s,n){const a=vr(e),i=a!==e&&!ms(e);let l=s,r=!1;a!==e&&(i?(r=n.length===0,l=function(c,d,u){return r&&(r=!1,c=Xs(e,c)),s.call(this,c,Xs(e,d),u,e)}):s.length>3&&(l=function(c,d,u){return s.call(this,c,d,u,e)}));const o=a[t](l,...n);return r?Xs(e,o):o}function Vr(e,t,s){const n=Je(e);Kt(n,"iterate",Di);const a=n[t](...s);return(a===-1||a===!1)&&Qi(s[0])?(s[0]=Je(s[0]),n[t](...s)):a}function ri(e,t,s=[]){wn(),Xo();const n=Je(e)[t].apply(e,s);return ec(),Sn(),n}const Ig=ks("__proto__,__v_isRef,__isVue"),Sp=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Jt));function Og(e){Jt(e)||(e=String(e));const t=Je(this);return Kt(t,"has",e),t.hasOwnProperty(e)}class Tp{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const a=this._isReadonly,i=this._isShallow;if(s==="__v_isReactive")return!a;if(s==="__v_isReadonly")return a;if(s==="__v_isShallow")return i;if(s==="__v_raw")return n===(a?i?Op:Ip:i?Rp:Ap).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=ye(t);if(!a){let o;if(l&&(o=Ag[s]))return o;if(s==="hasOwnProperty")return Og}const r=Reflect.get(t,s,St(t)?t:n);if((Jt(s)?Sp.has(s):Ig(s))||(a||Kt(t,"get",s),i))return r;if(St(r)){const o=l&&ur(s)?r:r.value;return a&&Xe(o)?Ml(o):o}return Xe(r)?a?Ml(r):Hn(r):r}}class Cp extends Tp{constructor(t=!1){super(!1,t)}set(t,s,n,a){let i=t[s];const l=ye(t)&&ur(s);if(!this._isShallow){const c=tn(i);if(!ms(n)&&!tn(n)&&(i=Je(i),n=Je(n)),!l&&St(i)&&!St(n))return c||(i.value=n),!0}const r=l?Number(s)e,cl=e=>Reflect.getPrototypeOf(e);function Pg(e,t,s){return function(...n){const a=this.__v_raw,i=Je(a),l=La(i),r=e==="entries"||e===Symbol.iterator&&l,o=e==="keys"&&l,c=a[e](...n),d=s?vo:t?za:js;return!t&&Kt(i,"iterate",o?go:ea),ze(Object.create(c),{next(){const{value:u,done:p}=c.next();return p?{value:u,done:p}:{value:r?[d(u[0]),d(u[1])]:d(u),done:p}}})}}function dl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Fg(e,t){const s={get(a){const i=this.__v_raw,l=Je(i),r=Je(a);e||(Lt(a,r)&&Kt(l,"get",a),Kt(l,"get",r));const{has:o}=cl(l),c=t?vo:e?za:js;if(o.call(l,a))return c(i.get(a));if(o.call(l,r))return c(i.get(r));i!==l&&i.get(a)},get size(){const a=this.__v_raw;return!e&&Kt(Je(a),"iterate",ea),a.size},has(a){const i=this.__v_raw,l=Je(i),r=Je(a);return e||(Lt(a,r)&&Kt(l,"has",a),Kt(l,"has",r)),a===r?i.has(a):i.has(a)||i.has(r)},forEach(a,i){const l=this,r=l.__v_raw,o=Je(r),c=t?vo:e?za:js;return!e&&Kt(o,"iterate",ea),r.forEach((d,u)=>a.call(i,c(d),c(u),l))}};return ze(s,e?{add:dl("add"),set:dl("set"),delete:dl("delete"),clear:dl("clear")}:{add(a){const i=Je(this),l=cl(i),r=Je(a),o=!t&&!ms(a)&&!tn(a)?r:a;return l.has.call(i,o)||Lt(a,o)&&l.has.call(i,a)||Lt(r,o)&&l.has.call(i,r)||(i.add(o),fn(i,"add",o,o)),this},set(a,i){!t&&!ms(i)&&!tn(i)&&(i=Je(i));const l=Je(this),{has:r,get:o}=cl(l);let c=r.call(l,a);c||(a=Je(a),c=r.call(l,a));const d=o.call(l,a);return l.set(a,i),c?Lt(i,d)&&fn(l,"set",a,i):fn(l,"add",a,i),this},delete(a){const i=Je(this),{has:l,get:r}=cl(i);let o=l.call(i,a);o||(a=Je(a),o=l.call(i,a)),r&&r.call(i,a);const c=i.delete(a);return o&&fn(i,"delete",a,void 0),c},clear(){const a=Je(this),i=a.size!==0,l=a.clear();return i&&fn(a,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(a=>{s[a]=Pg(a,e,t)}),s}function br(e,t){const s=Fg(e,t);return(n,a,i)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?n:Reflect.get(tt(s,a)&&a in n?s:n,a,i)}const $g={get:br(!1,!1)},Ug={get:br(!1,!0)},Bg={get:br(!0,!1)},Hg={get:br(!0,!0)},Ap=new WeakMap,Rp=new WeakMap,Ip=new WeakMap,Op=new WeakMap;function zg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Hn(e){return tn(e)?e:yr(e,!1,Ng,$g,Ap)}function sc(e){return yr(e,!1,Dg,Ug,Rp)}function Ml(e){return yr(e,!0,Lg,Bg,Ip)}function Vg(e){return yr(e,!0,Mg,Hg,Op)}function yr(e,t,s,n,a){if(!Xe(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=a.get(e);if(i)return i;const l=zg(Qm(e));if(l===0)return e;const r=new Proxy(e,l===2?n:s);return a.set(e,r),r}function yn(e){return tn(e)?yn(e.__v_raw):!!(e&&e.__v_isReactive)}function tn(e){return!!(e&&e.__v_isReadonly)}function ms(e){return!!(e&&e.__v_isShallow)}function Qi(e){return e?!!e.__v_raw:!1}function Je(e){const t=e&&e.__v_raw;return t?Je(t):e}function Np(e){return!tt(e,"__v_skip")&&Object.isExtensible(e)&&dp(e,"__v_skip",!0),e}const js=e=>Xe(e)?Hn(e):e,za=e=>Xe(e)?Ml(e):e;function St(e){return e?e.__v_isRef===!0:!1}function h(e){return Lp(e,!1)}function nc(e){return Lp(e,!0)}function Lp(e,t){return St(e)?e:new jg(e,t)}class jg{constructor(t,s){this.dep=new gr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:Je(t),this._value=s?t:js(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||ms(t)||tn(t);t=n?t:Je(t),Lt(t,s)&&(this._rawValue=t,this._value=n?t:js(t),this.dep.trigger())}}function qg(e){e.dep&&e.dep.trigger()}function en(e){return St(e)?e.value:e}function Gg(e){return Ie(e)?e():en(e)}const Kg={get:(e,t,s)=>t==="__v_raw"?e:en(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const a=e[t];return St(a)&&!St(s)?(a.value=s,!0):Reflect.set(e,t,s,n)}};function ac(e){return yn(e)?e:new Proxy(e,Kg)}class Wg{constructor(t){this.__v_isRef=!0,this._value=void 0;const s=this.dep=new gr,{get:n,set:a}=t(s.track.bind(s),s.trigger.bind(s));this._get=n,this._set=a}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Dp(e){return new Wg(e)}function Zg(e){const t=ye(e)?new Array(e.length):{};for(const s in e)t[s]=Mp(e,s);return t}class Jg{constructor(t,s,n){this._object=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=Jt(s)?s:String(s),this._raw=Je(t);let a=!0,i=t;if(!ye(t)||Jt(this._key)||!ur(this._key))do a=!Qi(i)||ms(i);while(a&&(i=i.__v_raw));this._shallow=a}get value(){let t=this._object[this._key];return this._shallow&&(t=en(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&St(this._raw[this._key])){const s=this._object[this._key];if(St(s)){s.value=t;return}}this._object[this._key]=t}get dep(){return Eg(this._raw,this._key)}}class Yg{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Qg(e,t,s){return St(e)?e:Ie(e)?new Yg(e):Xe(e)&&arguments.length>1?Mp(e,t,s):h(e)}function Mp(e,t,s){return new Jg(e,t,s)}class Xg{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new gr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Li-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ot!==this)return bp(this,!0),!0}get value(){const t=this.dep.track();return _p(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ev(e,t,s=!1){let n,a;return Ie(e)?n=e:(n=e.get,a=e.set),new Xg(n,a,s)}const tv={GET:"get",HAS:"has",ITERATE:"iterate"},sv={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},ul={},Pl=new WeakMap;let Dn;function nv(){return Dn}function Pp(e,t=!1,s=Dn){if(s){let n=Pl.get(s);n||Pl.set(s,n=[]),n.push(e)}}function av(e,t,s=je){const{immediate:n,deep:a,once:i,scheduler:l,augmentJob:r,call:o}=s,c=_=>a?_:ms(_)||a===!1||a===0?hn(_,1):hn(_);let d,u,p,f,b=!1,y=!1;if(St(e)?(u=()=>e.value,b=ms(e)):yn(e)?(u=()=>c(e),b=!0):ye(e)?(y=!0,b=e.some(_=>yn(_)||ms(_)),u=()=>e.map(_=>{if(St(_))return _.value;if(yn(_))return c(_);if(Ie(_))return o?o(_,2):_()})):Ie(e)?t?u=o?()=>o(e,2):e:u=()=>{if(p){wn();try{p()}finally{Sn()}}const _=Dn;Dn=d;try{return o?o(e,3,[f]):e(f)}finally{Dn=_}}:u=Ht,t&&a){const _=u,S=a===!0?1/0:a;u=()=>hn(_(),S)}const E=gp(),O=()=>{d.stop(),E&&E.active&&Jo(E.effects,d)};if(i&&t){const _=t;t=(...S)=>{const g=_(...S);return O(),g}}let x=y?new Array(e.length).fill(ul):ul;const m=_=>{if(!(!(d.flags&1)||!d.dirty&&!_))if(t){const S=d.run();if(_||a||b||(y?S.some((g,w)=>Lt(g,x[w])):Lt(S,x))){p&&p();const g=Dn;Dn=d;try{const w=[S,x===ul?void 0:y&&x[0]===ul?[]:x,f];x=S,o?o(t,3,w):t(...w)}finally{Dn=g}}}else d.run()};return r&&r(m),d=new Ni(u),d.scheduler=l?()=>l(m,!1):m,f=_=>Pp(_,!1,d),p=d.onStop=()=>{const _=Pl.get(d);if(_){if(o)o(_,4);else for(const S of _)S();Pl.delete(d)}},t?n?m(!0):x=d.run():l?l(m.bind(null,!0),!0):d.run(),O.pause=d.pause.bind(d),O.resume=d.resume.bind(d),O.stop=O,O}function hn(e,t=1/0,s){if(t<=0||!Xe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,St(e))hn(e.value,t,s);else if(ye(e))for(let n=0;n{hn(n,t,s)});else if(dr(e)){for(const n in e)hn(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&hn(e[n],t,s)}return e}/** * @vue/runtime-core v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const $f=[];function iv(e){$f.push(e)}function lv(){$f.pop()}function rv(e,t){}const ov={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},cv={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function ti(e,t,s,n){try{return n?e(...n):e()}catch(a){fa(a,t,s)}}function xs(e,t,s,n){if(Ie(e)){const a=ti(e,t,s,n);return a&&Yo(a)&&a.catch(i=>{fa(i,t,s)}),a}if(be(e)){const a=[];for(let i=0;i>>1,a=ts[n],i=Pi(a);i=Pi(s)?ts.push(e):ts.splice(uv(t),0,e),e.flags|=1,Uf()}}function Uf(){Fl||(Fl=Bf.then(Hf))}function Mi(e){be(e)?Pa.push(...e):Mn&&e.id===-1?Mn.splice(Ca+1,0,e):e.flags&1||(Pa.push(e),e.flags|=1),Uf()}function ud(e,t,s=Ys+1){for(;sPi(s)-Pi(n));if(Pa.length=0,Mn){Mn.push(...t);return}for(Mn=t,Ca=0;Cae.id==null?e.flags&2?-1:1/0:e.id;function Hf(e){try{for(Ys=0;YsEa.emit(a,...i)),fl=[]):typeof window<"u"&&window.HTMLElement&&!((n=(s=window.navigator)==null?void 0:s.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{zf(i,t)}),setTimeout(()=>{Ea||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,fl=[])},3e3)):fl=[]}let Ut=null,xr=null;function Fi(e){const t=Ut;return Ut=e,xr=e&&e.type.__scopeId||null,t}function fv(e){xr=e}function pv(){xr=null}const hv=e=>lc;function lc(e,t=Ut,s){if(!t||e._n)return e;const n=(...a)=>{n._d&&Hi(-1);const i=Fi(t);let l;try{l=e(...a)}finally{Fi(i),n._d&&Hi(1)}return l};return n._n=!0,n._c=!0,n._d=!0,n}function mv(e,t){if(Ut===null)return e;const s=sl(Ut),n=e.dirs||(e.dirs=[]);for(let a=0;a1)return s&&Ie(t)?t.call(n&&n.proxy):t}}function gv(){return!!(as()||ta)}const Vf=Symbol.for("v-scx"),jf=()=>Os(Vf);function vv(e,t){return Xi(e,null,t)}function bv(e,t){return Xi(e,null,{flush:"post"})}function qf(e,t){return Xi(e,null,{flush:"sync"})}function ns(e,t,s){return Xi(e,t,s)}function Xi(e,t,s=je){const{immediate:n,deep:a,flush:i,once:l}=s,r=ze({},s),o=t&&n||!t&&i!=="post";let c;if(la){if(i==="sync"){const p=jf();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!o){const p=()=>{};return p.stop=Ht,p.resume=Ht,p.pause=Ht,p}}const d=Bt;r.call=(p,b,y)=>xs(p,d,b,y);let u=!1;i==="post"?r.scheduler=p=>{kt(p,d&&d.suspense)}:i!=="sync"&&(u=!0,r.scheduler=(p,b)=>{b?p():ic(p)}),r.augmentJob=p=>{t&&(p.flags|=4),u&&(p.flags|=2,d&&(p.id=d.uid,p.i=d))};const f=av(e,t,r);return la&&(c?c.push(f):o&&f()),f}function yv(e,t,s){const n=this.proxy,a=Me(e)?e.includes(".")?Gf(n,e):()=>n[e]:e.bind(n,n);let i;Ie(t)?i=t:(i=t.handler,s=t);const l=si(this),r=Xi(a,i.bind(n),s);return l(),r}function Gf(e,t){const s=t.split(".");return()=>{let n=e;for(let a=0;ae.__isTeleport,Jn=e=>e&&(e.disabled||e.disabled===""),xv=e=>e&&(e.defer||e.defer===""),fd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,pd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,bo=(e,t)=>{const s=e&&e.to;return Me(s)?t?t(s):null:s},_v={name:"Teleport",__isTeleport:!0,process(e,t,s,n,a,i,l,r,o,c){const{mc:d,pc:u,pbc:f,o:{insert:p,querySelector:b,createText:y,createComment:E,parentNode:I}}=c,x=Jn(t.props);let{dynamicChildren:m}=t;const _=(w,T,C)=>{w.shapeFlag&16&&d(w.children,T,C,a,i,l,r,o)},S=(w=t)=>{const T=Jn(w.props),C=w.target=bo(w.props,b),M=yo(C,w,y,p);C&&(l!=="svg"&&fd(C)?l="svg":l!=="mathml"&&pd(C)&&(l="mathml"),a&&a.isCE&&(a.ce._teleportTargets||(a.ce._teleportTargets=new Set)).add(C),T||(_(w,C,M),gi(w,!1)))},g=w=>{const T=()=>{if(Nn.get(w)===T){if(Nn.delete(w),Jn(w.props)){const C=I(w.el)||s;_(w,C,w.anchor),gi(w,!0)}S(w)}};Nn.set(w,T),kt(T,i)};if(e==null){const w=t.el=y(""),T=t.anchor=y("");if(p(w,s,n),p(T,s,n),xv(t.props)||i&&i.pendingBranch){g(t);return}x&&(_(t,s,T),gi(t,!0)),S()}else{t.el=e.el;const w=t.anchor=e.anchor,T=Nn.get(e);if(T){T.flags|=8,Nn.delete(e),g(t);return}t.targetStart=e.targetStart;const C=t.target=e.target,M=t.targetAnchor=e.targetAnchor,H=Jn(e.props),P=H?s:C,R=H?w:M;if(l==="svg"||fd(C)?l="svg":(l==="mathml"||pd(C))&&(l="mathml"),m?(f(e.dynamicChildren,m,P,a,i,l,r),vc(e,t,!0)):o||u(e,t,P,R,a,i,l,r,!1),x)H?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):pl(t,s,w,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=bo(t.props,b);j&&pl(t,j,null,c,0)}else H&&pl(t,C,M,c,1);gi(t,x)}},remove(e,t,s,{um:n,o:{remove:a}},i){const{shapeFlag:l,children:r,anchor:o,targetStart:c,targetAnchor:d,target:u,props:f}=e,p=i||!Jn(f),b=Nn.get(e);if(b&&(b.flags|=8,Nn.delete(e)),u&&(a(c),a(d)),i&&a(o),!b&&l&16)for(let y=0;y{e.isMounted=!0}),Sr(()=>{e.isUnmounting=!0}),e}const Es=[Function,Array],oc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Es,onEnter:Es,onAfterEnter:Es,onEnterCancelled:Es,onBeforeLeave:Es,onLeave:Es,onAfterLeave:Es,onLeaveCancelled:Es,onBeforeAppear:Es,onAppear:Es,onAfterAppear:Es,onAppearCancelled:Es},Zf=e=>{const t=e.subTree;return t.component?Zf(t.component):t},Sv={name:"BaseTransition",props:oc,setup(e,{slots:t}){const s=as(),n=rc();return()=>{const a=t.default&&_r(t.default(),!0),i=a&&a.length?Jf(a):s.subTree?Np():void 0;if(!i)return;const l=Je(e),{mode:r}=l;if(n.isLeaving)return jr(i);const o=hd(i);if(!o)return jr(i);let c=Va(o,l,n,s,u=>c=u);o.type!==yt&&Tn(o,c);let d=s.subTree&&hd(s.subTree);if(d&&d.type!==yt&&!Hs(d,o)&&Zf(s).type!==yt){let u=Va(d,l,n,s);if(Tn(d,u),r==="out-in"&&o.type!==yt)return n.isLeaving=!0,u.afterLeave=()=>{n.isLeaving=!1,s.job.flags&8||s.update(),delete u.afterLeave,d=void 0},jr(i);r==="in-out"&&o.type!==yt?u.delayLeave=(f,p,b)=>{const y=Qf(n,d);y[String(d.key)]=d,f[As]=()=>{p(),f[As]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{b(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function Jf(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==yt){t=s;break}}return t}const Yf=Sv;function Qf(e,t){const{leavingVNodes:s}=e;let n=s.get(t.type);return n||(n=Object.create(null),s.set(t.type,n)),n}function Va(e,t,s,n,a){const{appear:i,mode:l,persisted:r=!1,onBeforeEnter:o,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:f,onLeave:p,onAfterLeave:b,onLeaveCancelled:y,onBeforeAppear:E,onAppear:I,onAfterAppear:x,onAppearCancelled:m}=t,_=String(e.key),S=Qf(s,e),g=(C,M)=>{C&&xs(C,n,9,M)},w=(C,M)=>{const H=M[1];g(C,M),be(C)?C.every(P=>P.length<=1)&&H():C.length<=1&&H()},T={mode:l,persisted:r,beforeEnter(C){let M=o;if(!s.isMounted)if(i)M=E||o;else return;C[As]&&C[As](!0);const H=S[_];H&&Hs(e,H)&&H.el[As]&&H.el[As](),g(M,[C])},enter(C){if(S[_]===e)return;let M=c,H=d,P=u;if(!s.isMounted)if(i)M=I||c,H=x||d,P=m||u;else return;let R=!1;C[oi]=Q=>{R||(R=!0,Q?g(P,[C]):g(H,[C]),T.delayedLeave&&T.delayedLeave(),C[oi]=void 0)};const j=C[oi].bind(null,!1);M?w(M,[C,j]):j()},leave(C,M){const H=String(e.key);if(C[oi]&&C[oi](!0),s.isUnmounting)return M();g(f,[C]);let P=!1;C[As]=j=>{P||(P=!0,M(),j?g(y,[C]):g(b,[C]),C[As]=void 0,S[H]===e&&delete S[H])};const R=C[As].bind(null,!1);S[H]=e,p?w(p,[C,R]):R()},clone(C){const M=Va(C,t,s,n,a);return a&&a(M),M}};return T}function jr(e){if(tl(e))return e=sn(e),e.children=null,e}function hd(e){if(!tl(e))return Wf(e.type)&&e.children?Jf(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&Ie(s.default))return s.default()}}function Tn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Tn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _r(e,t=!1,s){let n=[],a=0;for(let i=0;i1)for(let i=0;is.value,set:i=>s.value=i})}return s}function md(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Bl=new WeakMap;function Fa(e,t,s,n,a=!1){if(be(e)){e.forEach((y,E)=>Fa(y,t&&(be(t)?t[E]:t),s,n,a));return}if(xn(n)&&!a){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Fa(e,t,s,n.component.subTree);return}const i=n.shapeFlag&4?sl(n.component):n.el,l=a?null:i,{i:r,r:o}=e,c=t&&t.r,d=r.refs===je?r.refs={}:r.refs,u=r.setupState,f=Je(u),p=u===je?Ia:y=>md(d,y)?!1:tt(f,y),b=(y,E)=>!(E&&md(d,E));if(c!=null&&c!==o){if(gd(t),Me(c))d[c]=null,p(c)&&(u[c]=null);else if(St(c)){const y=t;b(c,y.k)&&(c.value=null),y.k&&(d[y.k]=null)}}if(Ie(o))ti(o,r,12,[l,d]);else{const y=Me(o),E=St(o);if(y||E){const I=()=>{if(e.f){const x=y?p(o)?u[o]:d[o]:b()||!e.k?o.value:d[e.k];if(a)be(x)&&Jo(x,i);else if(be(x))x.includes(i)||x.push(i);else if(y)d[o]=[i],p(o)&&(u[o]=d[o]);else{const m=[i];b(o,e.k)&&(o.value=m),e.k&&(d[e.k]=m)}}else y?(d[o]=l,p(o)&&(u[o]=l)):E&&(b(o,e.k)&&(o.value=l),e.k&&(d[e.k]=l))};if(l){const x=()=>{I(),Bl.delete(e)};x.id=-1,Bl.set(e,x),kt(x,s)}else gd(e),I()}}}function gd(e){const t=Bl.get(e);t&&(t.flags|=8,Bl.delete(e))}let vd=!1;const _a=()=>{vd||(console.error("Hydration completed but contains mismatches."),vd=!0)},Ev=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Av=e=>e.namespaceURI.includes("MathML"),hl=e=>{if(e.nodeType===1){if(Ev(e))return"svg";if(Av(e))return"mathml"}},Oa=e=>e.nodeType===8;function Rv(e){const{mt:t,p:s,o:{patchProp:n,createText:a,nextSibling:i,parentNode:l,remove:r,insert:o,createComment:c}}=e,d=(m,_)=>{if(!_.hasChildNodes()){s(null,m,_),$l(),_._vnode=m;return}u(_.firstChild,m,null,null,null),$l(),_._vnode=m},u=(m,_,S,g,w,T=!1)=>{T=T||!!_.dynamicChildren;const C=Oa(m)&&m.data==="[",M=()=>y(m,_,S,g,w,C),{type:H,ref:P,shapeFlag:R,patchFlag:j}=_;let Q=m.nodeType;_.el=m,j===-2&&(T=!1,_.dynamicChildren=null);let U=null;switch(H){case $n:Q!==3?_.children===""?(o(_.el=a(""),l(m),m),U=m):U=M():(m.data!==_.children&&(_a(),m.data=_.children),U=i(m));break;case yt:x(m)?(U=i(m),I(_.el=m.content.firstChild,m,S)):Q!==8||C?U=M():U=i(m);break;case sa:if(C&&(m=i(m),Q=m.nodeType),Q===1||Q===3){U=m;const O=!_.children.length;for(let N=0;N<_.staticCount;N++)O&&(_.children+=U.nodeType===1?U.outerHTML:U.data),N===_.staticCount-1&&(_.anchor=U),U=i(U);return C?i(U):U}else M();break;case Dt:C?U=b(m,_,S,g,w,T):U=M();break;default:if(R&1)(Q!==1||_.type.toLowerCase()!==m.tagName.toLowerCase())&&!x(m)?U=M():U=f(m,_,S,g,w,T);else if(R&6){_.slotScopeIds=w;const O=l(m);if(C?U=E(m):Oa(m)&&m.data==="teleport start"?U=E(m,m.data,"teleport end"):U=i(m),t(_,O,null,S,g,hl(O),T),xn(_)&&!_.type.__asyncResolved){let N;C?(N=ft(Dt),N.anchor=U?U.previousSibling:O.lastChild):N=m.nodeType===3?yc(""):ft("div"),N.el=m,_.component.subTree=N}}else R&64?Q!==8?U=M():U=_.type.hydrate(m,_,S,g,w,T,e,p):R&128&&(U=_.type.hydrate(m,_,S,g,hl(l(m)),w,T,e,u))}return P!=null&&Fa(P,null,g,_),U},f=(m,_,S,g,w,T)=>{T=T||!!_.dynamicChildren;const{type:C,props:M,patchFlag:H,shapeFlag:P,dirs:R,transition:j}=_,Q=C==="input"||C==="option";if(Q||H!==-1){R&&Qs(_,null,S,"created");let U=!1;if(x(m)){U=wp(null,j)&&S&&S.vnode.props&&S.vnode.props.appear;const N=m.content.firstChild;if(U){const Y=N.getAttribute("class");Y&&(N.$cls=Y),j.beforeEnter(N)}I(N,m,S),_.el=m=N}if(P&16&&!(M&&(M.innerHTML||M.textContent))){let N=p(m.firstChild,_,m,S,g,w,T);for(N&&!ml(m,1)&&_a();N;){const Y=N;N=N.nextSibling,r(Y)}}else if(P&8){let N=_.children;N[0]===` -`&&(m.tagName==="PRE"||m.tagName==="TEXTAREA")&&(N=N.slice(1));const{textContent:Y}=m;Y!==N&&Y!==N.replace(/\r\n|\r/g,` -`)&&(ml(m,0)||_a(),m.textContent=_.children)}if(M){if(Q||!T||H&48){const N=m.tagName.includes("-");for(const Y in M)(Q&&(Y.endsWith("value")||Y==="indeterminate")||ca(Y)&&!bn(Y)||Y[0]==="."||N&&!bn(Y))&&n(m,Y,null,M[Y],void 0,S)}else if(M.onClick)n(m,"onClick",null,M.onClick,void 0,S);else if(H&4&&yn(M.style))for(const N in M.style)M.style[N]}let O;(O=M&&M.onVnodeBeforeMount)&&ds(O,S,_),R&&Qs(_,null,S,"beforeMount"),((O=M&&M.onVnodeMounted)||R||U)&&Ep(()=>{O&&ds(O,S,_),U&&j.enter(m),R&&Qs(_,null,S,"mounted")},g)}return m.nextSibling},p=(m,_,S,g,w,T,C)=>{C=C||!!_.dynamicChildren;const M=_.children,H=M.length;let P=!1;for(let R=0;R{const{slotScopeIds:C}=_;C&&(w=w?w.concat(C):C);const M=l(m),H=p(i(m),_,M,S,g,w,T);return H&&Oa(H)&&H.data==="]"?i(_.anchor=H):(_a(),o(_.anchor=c("]"),M,H),H)},y=(m,_,S,g,w,T)=>{if(ml(m.parentElement,1)||_a(),_.el=null,T){const H=E(m);for(;;){const P=i(m);if(P&&P!==H)r(P);else break}}const C=i(m),M=l(m);return r(m),s(null,_,M,C,S,g,hl(M),w),S&&(S.vnode.el=_.el,Cr(S,_.el)),C},E=(m,_="[",S="]")=>{let g=0;for(;m;)if(m=i(m),m&&Oa(m)&&(m.data===_&&g++,m.data===S)){if(g===0)return i(m);g--}return m},I=(m,_,S)=>{const g=_.parentNode;g&&g.replaceChild(m,_);let w=S;for(;w;)w.vnode.el===_&&(w.vnode.el=w.subTree.el=m),w=w.parent},x=m=>m.nodeType===1&&m.tagName==="TEMPLATE";return[d,u]}const bd="data-allow-mismatch",Iv={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function ml(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(bd);)e=e.parentElement;const s=e&&e.getAttribute(bd);if(s==null)return!1;if(s==="")return!0;{const n=s.split(",");return t===0&&n.includes("children")?!0:n.includes(Iv[t])}}const Ov=hr().requestIdleCallback||(e=>setTimeout(e,1)),Nv=hr().cancelIdleCallback||(e=>clearTimeout(e)),Lv=(e=1e4)=>t=>{const s=Ov(t,{timeout:e});return()=>Nv(s)};function Dv(e){const{top:t,left:s,bottom:n,right:a}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:l}=window;return(t>0&&t0&&n0&&s0&&a(t,s)=>{const n=new IntersectionObserver(a=>{for(const i of a)if(i.isIntersecting){n.disconnect(),t();break}},e);return s(a=>{if(a instanceof Element){if(Dv(a))return t(),n.disconnect(),!1;n.observe(a)}}),()=>n.disconnect()},Pv=e=>t=>{if(e){const s=matchMedia(e);if(s.matches)t();else return s.addEventListener("change",t,{once:!0}),()=>s.removeEventListener("change",t)}},Fv=(e=[])=>(t,s)=>{Me(e)&&(e=[e]);let n=!1;const a=l=>{n||(n=!0,i(),t(),l.target.dispatchEvent(new l.constructor(l.type,l)))},i=()=>{s(l=>{for(const r of e)l.removeEventListener(r,a)})};return s(l=>{for(const r of e)l.addEventListener(r,a,{once:!0})}),i};function $v(e,t){if(Oa(e)&&e.data==="["){let s=1,n=e.nextSibling;for(;n;){if(n.nodeType===1){if(t(n)===!1)break}else if(Oa(n))if(n.data==="]"){if(--s===0)break}else n.data==="["&&s++;n=n.nextSibling}}else t(e)}const xn=e=>!!e.type.__asyncLoader;function Bv(e){Ie(e)&&(e={loader:e});const{loader:t,loadingComponent:s,errorComponent:n,delay:a=200,hydrate:i,timeout:l,suspensible:r=!0,onError:o}=e;let c=null,d,u=0;const f=()=>(u++,c=null,p()),p=()=>{let b;return c||(b=c=t().catch(y=>{if(y=y instanceof Error?y:new Error(String(y)),o)return new Promise((E,I)=>{o(y,()=>E(f()),()=>I(y),u+1)});throw y}).then(y=>b!==c&&c?c:(y&&(y.__esModule||y[Symbol.toStringTag]==="Module")&&(y=y.default),d=y,y)))};return el({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(b,y,E){let I=!1;(y.bu||(y.bu=[])).push(()=>I=!0);const x=()=>{I||E()},m=i?()=>{const _=i(x,S=>$v(b,S));_&&(y.bum||(y.bum=[])).push(_)}:x;d?m():p().then(()=>!y.isUnmounted&&m())},get __asyncResolved(){return d},setup(){const b=Bt;if(cc(b),d)return()=>gl(d,b);const y=S=>{c=null,fa(S,b,13,!n)};if(r&&b.suspense||la)return p().then(S=>()=>gl(S,b)).catch(S=>(y(S),()=>n?ft(n,{error:S}):null));const E=h(!1),I=h(),x=h(!!a);let m,_;return xt(()=>{m!=null&&clearTimeout(m),_!=null&&clearTimeout(_)}),a&&(_=setTimeout(()=>{b.isUnmounted||(x.value=!1)},a)),l!=null&&(m=setTimeout(()=>{if(!b.isUnmounted&&!E.value&&!I.value){const S=new Error(`Async component timed out after ${l}ms.`);y(S),I.value=S}},l)),p().then(()=>{b.isUnmounted||(E.value=!0,b.parent&&tl(b.parent.vnode)&&b.parent.update())}).catch(S=>{if(b.isUnmounted){c=null;return}y(S),I.value=S}),()=>{if(E.value&&d)return gl(d,b);if(I.value&&n)return ft(n,{error:I.value});if(s&&!x.value)return gl(s,b)}}})}function gl(e,t){const{ref:s,props:n,children:a,ce:i}=t.vnode,l=ft(e,n,a);return l.ref=s,l.ce=i,delete t.vnode.ce,l}const tl=e=>e.type.__isKeepAlive,Uv={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const s=as(),n=s.ctx;if(!n.renderer)return()=>{const x=t.default&&t.default();return x&&x.length===1?x[0]:x};const a=new Map,i=new Set;let l=null;const r=s.suspense,{renderer:{p:o,m:c,um:d,o:{createElement:u}}}=n,f=u("div");n.activate=(x,m,_,S,g)=>{const w=x.component;c(x,m,_,0,r),o(w.vnode,x,m,_,w,r,S,x.slotScopeIds,g),kt(()=>{w.isDeactivated=!1,w.a&&Ma(w.a);const T=x.props&&x.props.onVnodeMounted;T&&ds(T,w.parent,x)},r)},n.deactivate=x=>{const m=x.component;Hl(m.m),Hl(m.a),c(x,f,null,1,r),kt(()=>{m.da&&Ma(m.da);const _=x.props&&x.props.onVnodeUnmounted;_&&ds(_,m.parent,x),m.isDeactivated=!0},r)};function p(x){qr(x),d(x,s,r,!0)}function b(x){a.forEach((m,_)=>{const S=Ao(xn(m)?m.type.__asyncResolved||{}:m.type);S&&!x(S)&&y(_)})}function y(x){const m=a.get(x);m&&(!l||!Hs(m,l))?p(m):l&&qr(l),a.delete(x),i.delete(x)}ns(()=>[e.include,e.exclude],([x,m])=>{x&&b(_=>vi(x,_)),m&&b(_=>!vi(m,_))},{flush:"post",deep:!0});let E=null;const I=()=>{E!=null&&(zl(s.subTree.type)?kt(()=>{a.set(E,vl(s.subTree))},s.subTree.suspense):a.set(E,vl(s.subTree)))};return We(I),wr(I),Sr(()=>{a.forEach(x=>{const{subTree:m,suspense:_}=s,S=vl(m);if(x.type===S.type&&x.key===S.key){qr(S);const g=S.component.da;g&&kt(g,_);return}p(x)})}),()=>{if(E=null,!t.default)return l=null;const x=t.default(),m=x[0];if(x.length>1)return l=null,x;if(!Cn(m)||!(m.shapeFlag&4)&&!(m.shapeFlag&128))return l=null,m;let _=vl(m);if(_.type===yt)return l=null,_;const S=_.type,g=Ao(xn(_)?_.type.__asyncResolved||{}:S),{include:w,exclude:T,max:C}=e;if(w&&(!g||!vi(w,g))||T&&g&&vi(T,g))return _.shapeFlag&=-257,l=_,m;const M=_.key==null?S:_.key,H=a.get(M);return _.el&&(_=sn(_),m.shapeFlag&128&&(m.ssContent=_)),E=M,H?(_.el=H.el,_.component=H.component,_.transition&&Tn(_,_.transition),_.shapeFlag|=512,i.delete(M),i.add(M)):(i.add(M),C&&i.size>parseInt(C,10)&&y(i.values().next().value)),_.shapeFlag|=256,l=_,zl(m.type)?m:_}}},Hv=Uv;function vi(e,t){return be(e)?e.some(s=>vi(s,t)):Me(e)?e.split(",").includes(t):Ym(e)?(e.lastIndex=0,e.test(t)):!1}function Ds(e,t){Xf(e,"a",t)}function Ms(e,t){Xf(e,"da",t)}function Xf(e,t,s=Bt){const n=e.__wdc||(e.__wdc=()=>{let a=s;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(kr(t,n,s),s){let a=s.parent;for(;a&&a.parent;)tl(a.parent.vnode)&&zv(n,t,s,a),a=a.parent}}function zv(e,t,s,n){const a=kr(t,e,n,!0);xt(()=>{Jo(n[t],a)},s)}function qr(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function vl(e){return e.shapeFlag&128?e.ssContent:e}function kr(e,t,s=Bt,n=!1){if(s){const a=s[e]||(s[e]=[]),i=t.__weh||(t.__weh=(...l)=>{wn();const r=si(s),o=xs(t,s,e,l);return r(),Sn(),o});return n?a.unshift(i):a.push(i),i}}const En=e=>(t,s=Bt)=>{(!la||e==="sp")&&kr(e,(...n)=>t(...n),s)},ep=En("bm"),We=En("m"),dc=En("bu"),wr=En("u"),Sr=En("bum"),xt=En("um"),tp=En("sp"),sp=En("rtg"),np=En("rtc");function ap(e,t=Bt){kr("ec",e,t)}const uc="components",Vv="directives";function jv(e,t){return fc(uc,e,!0,t)||e}const ip=Symbol.for("v-ndc");function qv(e){return Me(e)?fc(uc,e,!1)||e:e||ip}function Gv(e){return fc(Vv,e)}function fc(e,t,s=!0,n=!1){const a=Ut||Bt;if(a){const i=a.type;if(e===uc){const r=Ao(i,!1);if(r&&(r===t||r===it(t)||r===ua(it(t))))return i}const l=yd(a[e]||i[e],t)||yd(a.appContext[e],t);return!l&&n?i:l}}function yd(e,t){return e&&(e[t]||e[it(t)]||e[ua(it(t))])}function Kv(e,t,s,n){let a;const i=s&&s[n],l=be(e);if(l||Me(e)){const r=l&&yn(e);let o=!1,c=!1;r&&(o=!ms(e),c=tn(e),e=vr(e)),a=new Array(e.length);for(let d=0,u=e.length;dt(r,o,void 0,i&&i[o]));else{const r=Object.keys(e);a=new Array(r.length);for(let o=0,c=r.length;o{const i=n.fn(...a);return i&&(i.key=n.key),i}:n.fn)}return e}function Zv(e,t,s={},n,a){if(Ut.ce||Ut.parent&&xn(Ut.parent)&&Ut.parent.ce){const c=Object.keys(s).length>0;return t!=="default"&&(s.name=t),Ui(),Vl(Dt,null,[ft("slot",s,n&&n())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),Ui();const l=i&&pc(i(s)),r=s.key||l&&l.key,o=Vl(Dt,{key:(r&&!Jt(r)?r:`_${t}`)+(!l&&n?"_fb":"")},l||(n?n():[]),l&&e._===1?64:-2);return!a&&o.scopeId&&(o.slotScopeIds=[o.scopeId+"-s"]),i&&i._c&&(i._d=!0),o}function pc(e){return e.some(t=>Cn(t)?!(t.type===yt||t.type===Dt&&!pc(t.children)):!0)?e:null}function Jv(e,t){const s={};for(const n in e)s[t&&/[A-Z]/.test(n)?`on:${n}`:Da(n)]=e[n];return s}const xo=e=>e?Mp(e)?sl(e):xo(e.parent):null,Si=ze(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>xo(e.parent),$root:e=>xo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>hc(e),$forceUpdate:e=>e.f||(e.f=()=>{ic(e.update)}),$nextTick:e=>e.n||(e.n=Rt.bind(e.proxy)),$watch:e=>yv.bind(e)}),Gr=(e,t)=>e!==je&&!e.__isScriptSetup&&tt(e,t),_o={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:a,props:i,accessCache:l,type:r,appContext:o}=e;if(t[0]!=="$"){const f=l[t];if(f!==void 0)switch(f){case 1:return n[t];case 2:return a[t];case 4:return s[t];case 3:return i[t]}else{if(Gr(n,t))return l[t]=1,n[t];if(a!==je&&tt(a,t))return l[t]=2,a[t];if(tt(i,t))return l[t]=3,i[t];if(s!==je&&tt(s,t))return l[t]=4,s[t];ko&&(l[t]=0)}}const c=Si[t];let d,u;if(c)return t==="$attrs"&&Kt(e.attrs,"get",""),c(e);if((d=r.__cssModules)&&(d=d[t]))return d;if(s!==je&&tt(s,t))return l[t]=4,s[t];if(u=o.config.globalProperties,tt(u,t))return u[t]},set({_:e},t,s){const{data:n,setupState:a,ctx:i}=e;return Gr(a,t)?(a[t]=s,!0):n!==je&&tt(n,t)?(n[t]=s,!0):tt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:a,props:i,type:l}},r){let o;return!!(s[r]||e!==je&&r[0]!=="$"&&tt(e,r)||Gr(t,r)||tt(i,r)||tt(n,r)||tt(Si,r)||tt(a.config.globalProperties,r)||(o=l.__cssModules)&&o[r])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:tt(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}},Yv=ze({},_o,{get(e,t){if(t!==Symbol.unscopables)return _o.get(e,t,e)},has(e,t){return t[0]!=="_"&&!ag(t)}});function Qv(){return null}function Xv(){return null}function eb(e){}function tb(e){}function sb(){return null}function nb(){}function ab(e,t){return null}function ib(){return lp().slots}function lb(){return lp().attrs}function lp(e){const t=as();return t.setupContext||(t.setupContext=Bp(t))}function $i(e){return be(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}function rb(e,t){const s=$i(e);for(const n in t){if(n.startsWith("__skip"))continue;let a=s[n];a?be(a)||Ie(a)?a=s[n]={type:a,default:t[n]}:a.default=t[n]:a===null&&(a=s[n]={default:t[n]}),a&&t[`__skip_${n}`]&&(a.skipFactory=!0)}return s}function ob(e,t){return!e||!t?e||t:be(e)&&be(t)?e.concat(t):ze({},$i(e),$i(t))}function cb(e,t){const s={};for(const n in e)t.includes(n)||Object.defineProperty(s,n,{enumerable:!0,get:()=>e[n]});return s}function db(e){const t=as(),s=la;let n=e();zi(),s&&Ba(!1);const a=()=>{si(t),s&&Ba(!0)},i=()=>{as()!==t&&t.scope.off(),zi(),s&&Ba(!1)};return Yo(n)&&(n=n.catch(l=>{throw a(),Promise.resolve().then(()=>Promise.resolve().then(i)),l})),[n,()=>{a(),Promise.resolve().then(i)}]}let ko=!0;function ub(e){const t=hc(e),s=e.proxy,n=e.ctx;ko=!1,t.beforeCreate&&xd(t.beforeCreate,e,"bc");const{data:a,computed:i,methods:l,watch:r,provide:o,inject:c,created:d,beforeMount:u,mounted:f,beforeUpdate:p,updated:b,activated:y,deactivated:E,beforeDestroy:I,beforeUnmount:x,destroyed:m,unmounted:_,render:S,renderTracked:g,renderTriggered:w,errorCaptured:T,serverPrefetch:C,expose:M,inheritAttrs:H,components:P,directives:R,filters:j}=t;if(c&&fb(c,n,null),l)for(const O in l){const N=l[O];Ie(N)&&(n[O]=N.bind(s))}if(a){const O=a.call(s,s);Xe(O)&&(e.data=Hn(O))}if(ko=!0,i)for(const O in i){const N=i[O],Y=Ie(N)?N.bind(s,s):Ie(N.get)?N.get.bind(s,s):Ht,we=!Ie(N)&&Ie(N.set)?N.set.bind(s):Ht,ke=J({get:Y,set:we});Object.defineProperty(n,O,{enumerable:!0,configurable:!0,get:()=>ke.value,set:ie=>ke.value=ie})}if(r)for(const O in r)rp(r[O],n,s,O);if(o){const O=Ie(o)?o.call(s):o;Reflect.ownKeys(O).forEach(N=>{wi(N,O[N])})}d&&xd(d,e,"c");function U(O,N){be(N)?N.forEach(Y=>O(Y.bind(s))):N&&O(N.bind(s))}if(U(ep,u),U(We,f),U(dc,p),U(wr,b),U(Ds,y),U(Ms,E),U(ap,T),U(np,g),U(sp,w),U(Sr,x),U(xt,_),U(tp,C),be(M))if(M.length){const O=e.exposed||(e.exposed={});M.forEach(N=>{Object.defineProperty(O,N,{get:()=>s[N],set:Y=>s[N]=Y,enumerable:!0})})}else e.exposed||(e.exposed={});S&&e.render===Ht&&(e.render=S),H!=null&&(e.inheritAttrs=H),P&&(e.components=P),R&&(e.directives=R),C&&cc(e)}function fb(e,t,s=Ht){be(e)&&(e=wo(e));for(const n in e){const a=e[n];let i;Xe(a)?"default"in a?i=Os(a.from||n,a.default,!0):i=Os(a.from||n):i=Os(a),St(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:l=>i.value=l}):t[n]=i}}function xd(e,t,s){xs(be(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function rp(e,t,s,n){let a=n.includes(".")?Gf(s,n):()=>s[n];if(Me(e)){const i=t[e];Ie(i)&&ns(a,i)}else if(Ie(e))ns(a,e.bind(s));else if(Xe(e))if(be(e))e.forEach(i=>rp(i,t,s,n));else{const i=Ie(e.handler)?e.handler.bind(s):t[e.handler];Ie(i)&&ns(a,i,e)}}function hc(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:a,optionsCache:i,config:{optionMergeStrategies:l}}=e.appContext,r=i.get(t);let o;return r?o=r:!a.length&&!s&&!n?o=t:(o={},a.length&&a.forEach(c=>Ul(o,c,l,!0)),Ul(o,t,l)),Xe(t)&&i.set(t,o),o}function Ul(e,t,s,n=!1){const{mixins:a,extends:i}=t;i&&Ul(e,i,s,!0),a&&a.forEach(l=>Ul(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const r=pb[l]||s&&s[l];e[l]=r?r(e[l],t[l]):t[l]}return e}const pb={data:_d,props:kd,emits:kd,methods:bi,computed:bi,beforeCreate:Qt,created:Qt,beforeMount:Qt,mounted:Qt,beforeUpdate:Qt,updated:Qt,beforeDestroy:Qt,beforeUnmount:Qt,destroyed:Qt,unmounted:Qt,activated:Qt,deactivated:Qt,errorCaptured:Qt,serverPrefetch:Qt,components:bi,directives:bi,watch:mb,provide:_d,inject:hb};function _d(e,t){return t?e?function(){return ze(Ie(e)?e.call(this,this):e,Ie(t)?t.call(this,this):t)}:t:e}function hb(e,t){return bi(wo(e),wo(t))}function wo(e){if(be(e)){const t={};for(let s=0;s{let d,u=je,f;return qf(()=>{const p=e[a];Lt(d,p)&&(d=p,c())}),{get(){return o(),s.get?s.get(d):d},set(p){const b=s.set?s.set(p):p;if(!Lt(b,d)&&!(u!==je&&Lt(p,u)))return;const y=n.vnode.props,E=!!(y&&(t in y||a in y||i in y)&&(`onUpdate:${t}`in y||`onUpdate:${a}`in y||`onUpdate:${i}`in y));E||(d=p,c()),n.emit(`update:${t}`,b),Lt(p,u)&&(Lt(p,b)&&!Lt(b,f)||E&&u!==je&&!Lt(b,d))&&c(),u=p,f=b}}});return r[Symbol.iterator]=()=>{let o=0;return{next(){return o<2?{value:o++?l||je:r,done:!1}:{done:!0}}}},r}const cp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${it(t)}Modifiers`]||e[`${ps(t)}Modifiers`];function yb(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||je;let a=s;const i=t.startsWith("update:"),l=i&&cp(n,t.slice(7));l&&(l.trim&&(a=s.map(d=>Me(d)?d.trim():d)),l.number&&(a=s.map(pr)));let r,o=n[r=Da(t)]||n[r=Da(it(t))];!o&&i&&(o=n[r=Da(ps(t))]),o&&xs(o,e,6,a);const c=n[r+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,xs(c,e,6,a)}}const xb=new WeakMap;function dp(e,t,s=!1){const n=s?xb:t.emitsCache,a=n.get(e);if(a!==void 0)return a;const i=e.emits;let l={},r=!1;if(!Ie(e)){const o=c=>{const d=dp(c,t,!0);d&&(r=!0,ze(l,d))};!s&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return!i&&!r?(Xe(e)&&n.set(e,null),null):(be(i)?i.forEach(o=>l[o]=null):ze(l,i),Xe(e)&&n.set(e,l),l)}function Tr(e,t){return!e||!ca(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,ps(t))||tt(e,t))}function Cl(e){const{type:t,vnode:s,proxy:n,withProxy:a,propsOptions:[i],slots:l,attrs:r,emit:o,render:c,renderCache:d,props:u,data:f,setupState:p,ctx:b,inheritAttrs:y}=e,E=Fi(e);let I,x;try{if(s.shapeFlag&4){const _=a||n,S=_;I=fs(c.call(S,_,d,u,p,f,b)),x=r}else{const _=t;I=fs(_.length>1?_(u,{attrs:r,slots:l,emit:o}):_(u,null)),x=t.props?r:kb(r)}}catch(_){Ti.length=0,fa(_,e,1),I=ft(yt)}let m=I;if(x&&y!==!1){const _=Object.keys(x),{shapeFlag:S}=m;_.length&&S&7&&(i&&_.some(cr)&&(x=wb(x,i)),m=sn(m,x,!1,!0))}return s.dirs&&(m=sn(m,null,!1,!0),m.dirs=m.dirs?m.dirs.concat(s.dirs):s.dirs),s.transition&&Tn(m,s.transition),I=m,Fi(E),I}function _b(e,t=!0){let s;for(let n=0;n{let t;for(const s in e)(s==="class"||s==="style"||ca(s))&&((t||(t={}))[s]=e[s]);return t},wb=(e,t)=>{const s={};for(const n in e)(!cr(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Sb(e,t,s){const{props:n,children:a,component:i}=e,{props:l,children:r,patchFlag:o}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&o>=0){if(o&1024)return!0;if(o&16)return n?wd(n,l,c):!!l;if(o&8){const d=t.dynamicProps;for(let u=0;uObject.create(fp),hp=e=>Object.getPrototypeOf(e)===fp;function Tb(e,t,s,n=!1){const a={},i=pp();e.propsDefaults=Object.create(null),mp(e,t,a,i);for(const l in e.propsOptions[0])l in a||(a[l]=void 0);s?e.props=n?a:sc(a):e.type.props?e.props=a:e.props=i,e.attrs=i}function Cb(e,t,s,n){const{props:a,attrs:i,vnode:{patchFlag:l}}=e,r=Je(a),[o]=e.propsOptions;let c=!1;if((n||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let u=0;u{o=!0;const[f,p]=gp(u,t,!0);ze(l,f),p&&r.push(...p)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!o)return Xe(e)&&n.set(e,Na),Na;if(be(i))for(let d=0;de==="_"||e==="_ctx"||e==="$stable",gc=e=>be(e)?e.map(fs):[fs(e)],Ab=(e,t,s)=>{if(t._n)return t;const n=lc((...a)=>gc(t(...a)),s);return n._c=!1,n},vp=(e,t,s)=>{const n=e._ctx;for(const a in e){if(mc(a))continue;const i=e[a];if(Ie(i))t[a]=Ab(a,i,n);else if(i!=null){const l=gc(i);t[a]=()=>l}}},bp=(e,t)=>{const s=gc(t);e.slots.default=()=>s},yp=(e,t,s)=>{for(const n in t)(s||!mc(n))&&(e[n]=t[n])},Rb=(e,t,s)=>{const n=e.slots=pp();if(e.vnode.shapeFlag&32){const a=t._;a?(yp(n,t,s),s&&uf(n,"_",a,!0)):vp(t,n)}else t&&bp(e,t)},Ib=(e,t,s)=>{const{vnode:n,slots:a}=e;let i=!0,l=je;if(n.shapeFlag&32){const r=t._;r?s&&r===1?i=!1:yp(a,t,s):(i=!t.$stable,vp(t,a)),l=t}else t&&(bp(e,t),l={default:1});if(i)for(const r in a)!mc(r)&&l[r]==null&&delete a[r]},kt=Ep;function xp(e){return kp(e)}function _p(e){return kp(e,Rv)}function kp(e,t){const s=hr();s.__VUE__=!0;const{insert:n,remove:a,patchProp:i,createElement:l,createText:r,createComment:o,setText:c,setElementText:d,parentNode:u,nextSibling:f,setScopeId:p=Ht,insertStaticContent:b}=e,y=(k,L,$,ee=null,Z=null,X=null,ue=void 0,oe=null,le=!!L.dynamicChildren)=>{if(k===L)return;k&&!Hs(k,L)&&(ee=V(k),ie(k,Z,X,!0),k=null),L.patchFlag===-2&&(le=!1,L.dynamicChildren=null);const{type:te,ref:ne,shapeFlag:fe}=L;switch(te){case $n:E(k,L,$,ee);break;case yt:I(k,L,$,ee);break;case sa:k==null&&x(L,$,ee,ue);break;case Dt:P(k,L,$,ee,Z,X,ue,oe,le);break;default:fe&1?S(k,L,$,ee,Z,X,ue,oe,le):fe&6?R(k,L,$,ee,Z,X,ue,oe,le):(fe&64||fe&128)&&te.process(k,L,$,ee,Z,X,ue,oe,le,ye)}ne!=null&&Z?Fa(ne,k&&k.ref,X,L||k,!L):ne==null&&k&&k.ref!=null&&Fa(k.ref,null,X,k,!0)},E=(k,L,$,ee)=>{if(k==null)n(L.el=r(L.children),$,ee);else{const Z=L.el=k.el;L.children!==k.children&&c(Z,L.children)}},I=(k,L,$,ee)=>{k==null?n(L.el=o(L.children||""),$,ee):L.el=k.el},x=(k,L,$,ee)=>{[k.el,k.anchor]=b(k.children,L,$,ee,k.el,k.anchor)},m=({el:k,anchor:L},$,ee)=>{let Z;for(;k&&k!==L;)Z=f(k),n(k,$,ee),k=Z;n(L,$,ee)},_=({el:k,anchor:L})=>{let $;for(;k&&k!==L;)$=f(k),a(k),k=$;a(L)},S=(k,L,$,ee,Z,X,ue,oe,le)=>{if(L.type==="svg"?ue="svg":L.type==="math"&&(ue="mathml"),k==null)g(L,$,ee,Z,X,ue,oe,le);else{const te=k.el&&k.el._isVueCE?k.el:null;try{te&&te._beginPatch(),C(k,L,Z,X,ue,oe,le)}finally{te&&te._endPatch()}}},g=(k,L,$,ee,Z,X,ue,oe)=>{let le,te;const{props:ne,shapeFlag:fe,transition:ve,dirs:Te}=k;if(le=k.el=l(k.type,X,ne&&ne.is,ne),fe&8?d(le,k.children):fe&16&&T(k.children,le,null,ee,Z,Kr(k,X),ue,oe),Te&&Qs(k,null,ee,"created"),w(le,k,k.scopeId,ue,ee),ne){for(const Le in ne)Le!=="value"&&!bn(Le)&&i(le,Le,null,ne[Le],X,ee);"value"in ne&&i(le,"value",null,ne.value,X),(te=ne.onVnodeBeforeMount)&&ds(te,ee,k)}Te&&Qs(k,null,ee,"beforeMount");const Oe=wp(Z,ve);Oe&&ve.beforeEnter(le),n(le,L,$),((te=ne&&ne.onVnodeMounted)||Oe||Te)&&kt(()=>{try{te&&ds(te,ee,k),Oe&&ve.enter(le),Te&&Qs(k,null,ee,"mounted")}finally{}},Z)},w=(k,L,$,ee,Z)=>{if($&&p(k,$),ee)for(let X=0;X{for(let te=le;te{const oe=L.el=k.el;let{patchFlag:le,dynamicChildren:te,dirs:ne}=L;le|=k.patchFlag&16;const fe=k.props||je,ve=L.props||je;let Te;if($&&qn($,!1),(Te=ve.onVnodeBeforeUpdate)&&ds(Te,$,L,k),ne&&Qs(L,k,$,"beforeUpdate"),$&&qn($,!0),(fe.innerHTML&&ve.innerHTML==null||fe.textContent&&ve.textContent==null)&&d(oe,""),te?M(k.dynamicChildren,te,oe,$,ee,Kr(L,Z),X):ue||N(k,L,oe,null,$,ee,Kr(L,Z),X,!1),le>0){if(le&16)H(oe,fe,ve,$,Z);else if(le&2&&fe.class!==ve.class&&i(oe,"class",null,ve.class,Z),le&4&&i(oe,"style",fe.style,ve.style,Z),le&8){const Oe=L.dynamicProps;for(let Le=0;Le{Te&&ds(Te,$,L,k),ne&&Qs(L,k,$,"updated")},ee)},M=(k,L,$,ee,Z,X,ue)=>{for(let oe=0;oe{if(L!==$){if(L!==je)for(const X in L)!bn(X)&&!(X in $)&&i(k,X,L[X],null,Z,ee);for(const X in $){if(bn(X))continue;const ue=$[X],oe=L[X];ue!==oe&&X!=="value"&&i(k,X,oe,ue,Z,ee)}"value"in $&&i(k,"value",L.value,$.value,Z)}},P=(k,L,$,ee,Z,X,ue,oe,le)=>{const te=L.el=k?k.el:r(""),ne=L.anchor=k?k.anchor:r("");let{patchFlag:fe,dynamicChildren:ve,slotScopeIds:Te}=L;Te&&(oe=oe?oe.concat(Te):Te),k==null?(n(te,$,ee),n(ne,$,ee),T(L.children||[],$,ne,Z,X,ue,oe,le)):fe>0&&fe&64&&ve&&k.dynamicChildren&&k.dynamicChildren.length===ve.length?(M(k.dynamicChildren,ve,$,Z,X,ue,oe),(L.key!=null||Z&&L===Z.subTree)&&vc(k,L,!0)):N(k,L,$,ne,Z,X,ue,oe,le)},R=(k,L,$,ee,Z,X,ue,oe,le)=>{L.slotScopeIds=oe,k==null?L.shapeFlag&512?Z.ctx.activate(L,$,ee,ue,le):j(L,$,ee,Z,X,ue,le):Q(k,L,le)},j=(k,L,$,ee,Z,X,ue)=>{const oe=k.component=Dp(k,ee,Z);if(tl(k)&&(oe.ctx.renderer=ye),Pp(oe,!1,ue),oe.asyncDep){if(Z&&Z.registerDep(oe,U,ue),!k.el){const le=oe.subTree=ft(yt);I(null,le,L,$),k.placeholder=le.el}}else U(oe,k,L,$,Z,X,ue)},Q=(k,L,$)=>{const ee=L.component=k.component;if(Sb(k,L,$))if(ee.asyncDep&&!ee.asyncResolved){O(ee,L,$);return}else ee.next=L,ee.update();else L.el=k.el,ee.vnode=L},U=(k,L,$,ee,Z,X,ue)=>{const oe=()=>{if(k.isMounted){let{next:fe,bu:ve,u:Te,parent:Oe,vnode:Le}=k;{const K=Sp(k);if(K){fe&&(fe.el=Le.el,O(k,fe,ue)),K.asyncDep.then(()=>{kt(()=>{k.isUnmounted||te()},Z)});return}}let De=fe,Be;qn(k,!1),fe?(fe.el=Le.el,O(k,fe,ue)):fe=Le,ve&&Ma(ve),(Be=fe.props&&fe.props.onVnodeBeforeUpdate)&&ds(Be,Oe,fe,Le),qn(k,!0);const qe=Cl(k),ct=k.subTree;k.subTree=qe,y(ct,qe,u(ct.el),V(ct),k,Z,X),fe.el=qe.el,De===null&&Cr(k,qe.el),Te&&kt(Te,Z),(Be=fe.props&&fe.props.onVnodeUpdated)&&kt(()=>ds(Be,Oe,fe,Le),Z)}else{let fe;const{el:ve,props:Te}=L,{bm:Oe,m:Le,parent:De,root:Be,type:qe}=k,ct=xn(L);if(qn(k,!1),Oe&&Ma(Oe),!ct&&(fe=Te&&Te.onVnodeBeforeMount)&&ds(fe,De,L),qn(k,!0),ve&&He){const K=()=>{k.subTree=Cl(k),He(ve,k.subTree,k,Z,null)};ct&&qe.__asyncHydrate?qe.__asyncHydrate(ve,k,K):K()}else{Be.ce&&Be.ce._hasShadowRoot()&&Be.ce._injectChildStyle(qe,k.parent?k.parent.type:void 0);const K=k.subTree=Cl(k);y(null,K,$,ee,k,Z,X),L.el=K.el}if(Le&&kt(Le,Z),!ct&&(fe=Te&&Te.onVnodeMounted)){const K=L;kt(()=>ds(fe,De,K),Z)}(L.shapeFlag&256||De&&xn(De.vnode)&&De.vnode.shapeFlag&256)&&k.a&&kt(k.a,Z),k.isMounted=!0,L=$=ee=null}};k.scope.on();const le=k.effect=new Ni(oe);k.scope.off();const te=k.update=le.run.bind(le),ne=k.job=le.runIfDirty.bind(le);ne.i=k,ne.id=k.uid,le.scheduler=()=>ic(ne),qn(k,!0),te()},O=(k,L,$)=>{L.component=k;const ee=k.vnode.props;k.vnode=L,k.next=null,Cb(k,L.props,ee,$),Ib(k,L.children,$),wn(),ud(k),Sn()},N=(k,L,$,ee,Z,X,ue,oe,le=!1)=>{const te=k&&k.children,ne=k?k.shapeFlag:0,fe=L.children,{patchFlag:ve,shapeFlag:Te}=L;if(ve>0){if(ve&128){we(te,fe,$,ee,Z,X,ue,oe,le);return}else if(ve&256){Y(te,fe,$,ee,Z,X,ue,oe,le);return}}Te&8?(ne&16&&Se(te,Z,X),fe!==te&&d($,fe)):ne&16?Te&16?we(te,fe,$,ee,Z,X,ue,oe,le):Se(te,Z,X,!0):(ne&8&&d($,""),Te&16&&T(fe,$,ee,Z,X,ue,oe,le))},Y=(k,L,$,ee,Z,X,ue,oe,le)=>{k=k||Na,L=L||Na;const te=k.length,ne=L.length,fe=Math.min(te,ne);let ve;for(ve=0;vene?Se(k,Z,X,!0,!1,fe):T(L,$,ee,Z,X,ue,oe,le,fe)},we=(k,L,$,ee,Z,X,ue,oe,le)=>{let te=0;const ne=L.length;let fe=k.length-1,ve=ne-1;for(;te<=fe&&te<=ve;){const Te=k[te],Oe=L[te]=le?un(L[te]):fs(L[te]);if(Hs(Te,Oe))y(Te,Oe,$,null,Z,X,ue,oe,le);else break;te++}for(;te<=fe&&te<=ve;){const Te=k[fe],Oe=L[ve]=le?un(L[ve]):fs(L[ve]);if(Hs(Te,Oe))y(Te,Oe,$,null,Z,X,ue,oe,le);else break;fe--,ve--}if(te>fe){if(te<=ve){const Te=ve+1,Oe=Teve)for(;te<=fe;)ie(k[te],Z,X,!0),te++;else{const Te=te,Oe=te,Le=new Map;for(te=Oe;te<=ve;te++){const Re=L[te]=le?un(L[te]):fs(L[te]);Re.key!=null&&Le.set(Re.key,te)}let De,Be=0;const qe=ve-Oe+1;let ct=!1,K=0;const xe=new Array(qe);for(te=0;te=qe){ie(Re,Z,X,!0);continue}let Ve;if(Re.key!=null)Ve=Le.get(Re.key);else for(De=Oe;De<=ve;De++)if(xe[De-Oe]===0&&Hs(Re,L[De])){Ve=De;break}Ve===void 0?ie(Re,Z,X,!0):(xe[Ve-Oe]=te+1,Ve>=K?K=Ve:ct=!0,y(Re,L[Ve],$,null,Z,X,ue,oe,le),Be++)}const Ce=ct?Ob(xe):Na;for(De=Ce.length-1,te=qe-1;te>=0;te--){const Re=Oe+te,Ve=L[Re],Pe=L[Re+1],pt=Re+1{const{el:X,type:ue,transition:oe,children:le,shapeFlag:te}=k;if(te&6){ke(k.component.subTree,L,$,ee);return}if(te&128){k.suspense.move(L,$,ee);return}if(te&64){ue.move(k,L,$,ye);return}if(ue===Dt){n(X,L,$);for(let fe=0;feoe.enter(X),Z));else{const{leave:fe,delayLeave:ve,afterLeave:Te}=oe,Oe=()=>{k.ctx.isUnmounted?a(X):n(X,L,$)},Le=()=>{const De=X._isLeaving||!!X[As];X._isLeaving&&X[As](!0),oe.persisted&&!De?Oe():fe(X,()=>{Oe(),Te&&Te()})};ve?ve(X,Oe,Le):Le()}else n(X,L,$)},ie=(k,L,$,ee=!1,Z=!1)=>{const{type:X,props:ue,ref:oe,children:le,dynamicChildren:te,shapeFlag:ne,patchFlag:fe,dirs:ve,cacheIndex:Te,memo:Oe}=k;if(fe===-2&&(Z=!1),oe!=null&&(wn(),Fa(oe,null,$,k,!0),Sn()),Te!=null&&(L.renderCache[Te]=void 0),ne&256){L.ctx.deactivate(k);return}const Le=ne&1&&ve,De=!xn(k);let Be;if(De&&(Be=ue&&ue.onVnodeBeforeUnmount)&&ds(Be,L,k),ne&6)se(k.component,$,ee);else{if(ne&128){k.suspense.unmount($,ee);return}Le&&Qs(k,null,L,"beforeUnmount"),ne&64?k.type.remove(k,L,$,ye,ee):te&&!te.hasOnce&&(X!==Dt||fe>0&&fe&64)?Se(te,L,$,!1,!0):(X===Dt&&fe&384||!Z&&ne&16)&&Se(le,L,$),ee&&he(k)}const qe=Oe!=null&&Te==null;(De&&(Be=ue&&ue.onVnodeUnmounted)||Le||qe)&&kt(()=>{Be&&ds(Be,L,k),Le&&Qs(k,null,L,"unmounted"),qe&&(k.el=null)},$)},he=k=>{const{type:L,el:$,anchor:ee,transition:Z}=k;if(L===Dt){F($,ee);return}if(L===sa){_(k);return}const X=()=>{a($),Z&&!Z.persisted&&Z.afterLeave&&Z.afterLeave()};if(k.shapeFlag&1&&Z&&!Z.persisted){const{leave:ue,delayLeave:oe}=Z,le=()=>ue($,X);oe?oe(k.el,X,le):le()}else X()},F=(k,L)=>{let $;for(;k!==L;)$=f(k),a(k),k=$;a(L)},se=(k,L,$)=>{const{bum:ee,scope:Z,job:X,subTree:ue,um:oe,m:le,a:te}=k;Hl(le),Hl(te),ee&&Ma(ee),Z.stop(),X&&(X.flags|=8,ie(ue,k,L,$)),oe&&kt(oe,L),kt(()=>{k.isUnmounted=!0},L)},Se=(k,L,$,ee=!1,Z=!1,X=0)=>{for(let ue=X;ue{if(k.shapeFlag&6)return V(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const L=f(k.anchor||k.el),$=L&&L[Kf];return $?f($):L};let de=!1;const ce=(k,L,$)=>{let ee;k==null?L._vnode&&(ie(L._vnode,null,null,!0),ee=L._vnode.component):y(L._vnode||null,k,L,null,null,null,$),L._vnode=k,de||(de=!0,ud(ee),$l(),de=!1)},ye={p:y,um:ie,m:ke,r:he,mt:j,mc:T,pc:N,pbc:M,n:V,o:e};let ge,He;return t&&([ge,He]=t(ye)),{render:ce,hydrate:ge,createApp:vb(ce,ge)}}function Kr({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function qn({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function wp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function vc(e,t,s=!1){const n=e.children,a=t.children;if(be(n)&&be(a))for(let i=0;i>1,e[s[r]]0&&(t[n]=s[i-1]),s[i]=n)}}for(i=s.length,l=s[i-1];i-- >0;)s[i]=l,l=t[l];return s}function Sp(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Sp(t)}function Hl(e){if(e)for(let t=0;te.__isSuspense;let To=0;const Nb={name:"Suspense",__isSuspense:!0,process(e,t,s,n,a,i,l,r,o,c){if(e==null)Db(t,s,n,a,i,l,r,o,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Mb(e,t,s,n,a,l,r,o,c)}},hydrate:Pb,normalize:Fb},Lb=Nb;function Bi(e,t){const s=e.props&&e.props[t];Ie(s)&&s()}function Db(e,t,s,n,a,i,l,r,o){const{p:c,o:{createElement:d}}=o,u=d("div"),f=e.suspense=Cp(e,a,n,t,u,s,i,l,r,o);c(null,f.pendingBranch=e.ssContent,u,null,n,f,i,l),f.deps>0?(Bi(e,"onPending"),Bi(e,"onFallback"),c(null,e.ssFallback,t,s,n,null,i,l),$a(f,e.ssFallback)):f.resolve(!1,!0)}function Mb(e,t,s,n,a,i,l,r,{p:o,um:c,o:{createElement:d}}){const u=t.suspense=e.suspense;u.vnode=t,t.el=e.el;const f=t.ssContent,p=t.ssFallback,{activeBranch:b,pendingBranch:y,isInFallback:E,isHydrating:I}=u;if(y)u.pendingBranch=f,Hs(y,f)?(o(y,f,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0?u.resolve():E&&(I||(o(b,p,s,n,a,null,i,l,r),$a(u,p)))):(u.pendingId=To++,I?(u.isHydrating=!1,u.activeBranch=y):c(y,a,u),u.deps=0,u.effects.length=0,u.hiddenContainer=d("div"),E?(o(null,f,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0?u.resolve():(o(b,p,s,n,a,null,i,l,r),$a(u,p))):b&&Hs(b,f)?(o(b,f,s,n,a,u,i,l,r),u.resolve(!0)):(o(null,f,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0&&u.resolve()));else if(b&&Hs(b,f))o(b,f,s,n,a,u,i,l,r),$a(u,f);else if(Bi(t,"onPending"),u.pendingBranch=f,f.shapeFlag&512?u.pendingId=f.component.suspenseId:u.pendingId=To++,o(null,f,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0)u.resolve();else{const{timeout:x,pendingId:m}=u;x>0?setTimeout(()=>{u.pendingId===m&&u.fallback(p)},x):x===0&&u.fallback(p)}}function Cp(e,t,s,n,a,i,l,r,o,c,d=!1){const{p:u,m:f,um:p,n:b,o:{parentNode:y,remove:E}}=c;let I;const x=$b(e);x&&t&&t.pendingBranch&&(I=t.pendingId,t.deps++);const m=e.props?Ll(e.props.timeout):void 0,_=i,S={vnode:e,parent:t,parentComponent:s,namespace:l,container:n,hiddenContainer:a,deps:0,pendingId:To++,timeout:typeof m=="number"?m:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(g=!1,w=!1){const{vnode:T,activeBranch:C,pendingBranch:M,pendingId:H,effects:P,parentComponent:R,container:j,isInFallback:Q}=S;let U=!1;if(S.isHydrating)S.isHydrating=!1;else if(!g){U=C&&M.transition&&M.transition.mode==="out-in";let Y=!1;U&&(C.transition.afterLeave=()=>{H===S.pendingId&&(f(M,j,i===_&&!Y?b(C):i,0),Mi(P),Q&&T.ssFallback&&(T.ssFallback.el=null))}),C&&!S.isFallbackMountPending&&(y(C.el)===j&&(i=b(C),Y=!0),p(C,R,S,!0),!U&&Q&&T.ssFallback&&kt(()=>T.ssFallback.el=null,S)),U||f(M,j,i,0)}S.isFallbackMountPending=!1,$a(S,M),S.pendingBranch=null,S.isInFallback=!1;let O=S.parent,N=!1;for(;O;){if(O.pendingBranch){O.effects.push(...P),N=!0;break}O=O.parent}!N&&!U&&Mi(P),S.effects=[],x&&t&&t.pendingBranch&&I===t.pendingId&&(t.deps--,t.deps===0&&!w&&t.resolve()),Bi(T,"onResolve")},fallback(g){if(!S.pendingBranch)return;const{vnode:w,activeBranch:T,parentComponent:C,container:M,namespace:H}=S;Bi(w,"onFallback");const P=b(T),R=()=>{S.isFallbackMountPending=!1,S.isInFallback&&(u(null,g,M,P,C,null,H,r,o),$a(S,g))},j=g.transition&&g.transition.mode==="out-in";j&&(S.isFallbackMountPending=!0,T.transition.afterLeave=R),S.isInFallback=!0,p(T,C,null,!0),j||R()},move(g,w,T){S.activeBranch&&f(S.activeBranch,g,w,T),S.container=g},next(){return S.activeBranch&&b(S.activeBranch)},registerDep(g,w,T){const C=!!S.pendingBranch;C&&S.deps++;const M=g.vnode.el;g.asyncDep.catch(H=>{fa(H,g,0)}).then(H=>{if(g.isUnmounted||S.isUnmounted||S.pendingId!==g.suspenseId)return;zi(),g.asyncResolved=!0;const{vnode:P}=g;Co(g,H,!1),M&&(P.el=M);const R=!M&&g.subTree.el;w(g,P,y(M||g.subTree.el),M?null:b(g.subTree),S,l,T),R&&(P.placeholder=null,E(R)),Cr(g,P.el),C&&--S.deps===0&&S.resolve()})},unmount(g,w){S.isUnmounted=!0,S.activeBranch&&p(S.activeBranch,s,g,w),S.pendingBranch&&p(S.pendingBranch,s,g,w)}};return S}function Pb(e,t,s,n,a,i,l,r,o){const c=t.suspense=Cp(t,n,s,e.parentNode,document.createElement("div"),null,a,i,l,r,!0),d=o(e,c.pendingBranch=t.ssContent,s,c,i,l);return c.deps===0&&c.resolve(!1,!0),d}function Fb(e){const{shapeFlag:t,children:s}=e,n=t&32;e.ssContent=Td(n?s.default:s),e.ssFallback=n?Td(s.fallback):ft(yt)}function Td(e){let t;if(Ie(e)){const s=ia&&e._c;s&&(e._d=!1,Ui()),e=e(),s&&(e._d=!0,t=Wt,Ap())}return be(e)&&(e=_b(e)),e=fs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(s=>s!==e)),e}function Ep(e,t){t&&t.pendingBranch?be(e)?t.effects.push(...e):t.effects.push(e):Mi(e)}function $a(e,t){e.activeBranch=t;const{vnode:s,parentComponent:n}=e;let a=t.el;for(;!a&&t.component;)t=t.component.subTree,a=t.el;s.el=a,n&&n.subTree===s&&(n.vnode.el=a,Cr(n,a))}function $b(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Dt=Symbol.for("v-fgt"),$n=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),sa=Symbol.for("v-stc"),Ti=[];let Wt=null;function Ui(e=!1){Ti.push(Wt=e?null:[])}function Ap(){Ti.pop(),Wt=Ti[Ti.length-1]||null}let ia=1;function Hi(e,t=!1){ia+=e,e<0&&Wt&&t&&(Wt.hasOnce=!0)}function Rp(e){return e.dynamicChildren=ia>0?Wt||Na:null,Ap(),ia>0&&Wt&&Wt.push(e),e}function Bb(e,t,s,n,a,i){return Rp(bc(e,t,s,n,a,i,!0))}function Vl(e,t,s,n,a){return Rp(ft(e,t,s,n,a,!0))}function Cn(e){return e?e.__v_isVNode===!0:!1}function Hs(e,t){return e.type===t.type&&e.key===t.key}function Ub(e){}const Ip=({key:e})=>e??null,El=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Me(e)||St(e)||Ie(e)?{i:Ut,r:e,k:t,f:!!s}:e:null);function bc(e,t=null,s=null,n=0,a=null,i=e===Dt?0:1,l=!1,r=!1){const o={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ip(t),ref:t&&El(t),scopeId:xr,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:n,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:Ut};return r?(xc(o,s),i&128&&e.normalize(o)):s&&(o.shapeFlag|=Me(s)?8:16),ia>0&&!l&&Wt&&(o.patchFlag>0||i&6)&&o.patchFlag!==32&&Wt.push(o),o}const ft=Hb;function Hb(e,t=null,s=null,n=0,a=null,i=!1){if((!e||e===ip)&&(e=yt),Cn(e)){const r=sn(e,t,!0);return s&&xc(r,s),ia>0&&!i&&Wt&&(r.shapeFlag&6?Wt[Wt.indexOf(e)]=r:Wt.push(r)),r.patchFlag=-2,r}if(Wb(e)&&(e=e.__vccOpts),t){t=Op(t);let{class:r,style:o}=t;r&&!Me(r)&&(t.class=Yi(r)),Xe(o)&&(Qi(o)&&!be(o)&&(o=ze({},o)),t.style=Ji(o))}const l=Me(e)?1:zl(e)?128:Wf(e)?64:Xe(e)?4:Ie(e)?2:0;return bc(e,t,s,n,a,l,i,!0)}function Op(e){return e?Qi(e)||hp(e)?ze({},e):e:null}function sn(e,t,s=!1,n=!1){const{props:a,ref:i,patchFlag:l,children:r,transition:o}=e,c=t?Lp(a||{},t):a,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Ip(c),ref:t&&t.ref?s&&i?be(i)?i.concat(El(t)):[i,El(t)]:El(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Dt?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:o,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&sn(e.ssContent),ssFallback:e.ssFallback&&sn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return o&&n&&Tn(d,o.clone(d)),d}function yc(e=" ",t=0){return ft($n,null,e,t)}function zb(e,t){const s=ft(sa,null,e);return s.staticCount=t,s}function Np(e="",t=!1){return t?(Ui(),Vl(yt,null,e)):ft(yt,null,e)}function fs(e){return e==null||typeof e=="boolean"?ft(yt):be(e)?ft(Dt,null,e.slice()):Cn(e)?un(e):ft($n,null,String(e))}function un(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sn(e)}function xc(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(be(t))s=16;else if(typeof t=="object")if(n&65){const a=t.default;a&&(a._c&&(a._d=!1),xc(e,a()),a._c&&(a._d=!0));return}else{s=32;const a=t._;!a&&!hp(t)?t._ctx=Ut:a===3&&Ut&&(Ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ie(t)?(t={default:t,_ctx:Ut},s=32):(t=String(t),n&64?(s=16,t=[yc(t)]):s=8);e.children=t,e.shapeFlag|=s}function Lp(...e){const t={};for(let s=0;sBt||Ut;let jl,Ba;{const e=hr(),t=(s,n)=>{let a;return(a=e[s])||(a=e[s]=[]),a.push(n),i=>{a.length>1?a.forEach(l=>l(i)):a[0](i)}};jl=t("__VUE_INSTANCE_SETTERS__",s=>Bt=s),Ba=t("__VUE_SSR_SETTERS__",s=>la=s)}const si=e=>{const t=Bt;return jl(e),e.scope.on(),()=>{e.scope.off(),jl(t)}},zi=()=>{Bt&&Bt.scope.off(),jl(null)};function Mp(e){return e.vnode.shapeFlag&4}let la=!1;function Pp(e,t=!1,s=!1){t&&Ba(t);const{props:n,children:a}=e.vnode,i=Mp(e);Tb(e,n,i,t),Rb(e,a,s||t);const l=i?qb(e,t):void 0;return t&&Ba(!1),l}function qb(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,_o);const{setup:n}=s;if(n){wn();const a=e.setupContext=n.length>1?Bp(e):null,i=si(e),l=ti(n,e,0,[e.props,a]),r=Yo(l);if(Sn(),i(),(r||e.sp)&&!xn(e)&&cc(e),r){if(l.then(zi,zi),t)return l.then(o=>{Co(e,o,t)}).catch(o=>{fa(o,e,0)});e.asyncDep=l}else Co(e,l,t)}else $p(e,t)}function Co(e,t,s){Ie(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Xe(t)&&(e.setupState=ac(t)),$p(e,s)}let ql,Eo;function Fp(e){ql=e,Eo=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,Yv))}}const Gb=()=>!ql;function $p(e,t,s){const n=e.type;if(!e.render){if(!t&&ql&&!n.render){const a=n.template||hc(e).template;if(a){const{isCustomElement:i,compilerOptions:l}=e.appContext.config,{delimiters:r,compilerOptions:o}=n,c=ze(ze({isCustomElement:i,delimiters:r},l),o);n.render=ql(a,c)}}e.render=n.render||Ht,Eo&&Eo(e)}{const a=si(e);wn();try{ub(e)}finally{Sn(),a()}}}const Kb={get(e,t){return Kt(e,"get",""),e[t]}};function Bp(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Kb),slots:e.slots,emit:e.emit,expose:t}}function sl(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ac(Lf(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Si)return Si[s](e)},has(t,s){return s in t||s in Si}})):e.proxy}function Ao(e,t=!0){return Ie(e)?e.displayName||e.name:e.name||t&&e.__name}function Wb(e){return Ie(e)&&"__vccOpts"in e}const J=(e,t)=>ev(e,t,la);function ja(e,t,s){try{Hi(-1);const n=arguments.length;return n===2?Xe(t)&&!be(t)?Cn(t)?ft(e,null,[t]):ft(e,t):ft(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&Cn(s)&&(s=[s]),ft(e,t,s))}finally{Hi(1)}}function Zb(){}function Jb(e,t,s,n){const a=s[n];if(a&&Up(a,e))return a;const i=t();return i.memo=e.slice(),i.cacheIndex=n,s[n]=i}function Up(e,t){const s=e.memo;if(s.length!=t.length)return!1;for(let n=0;n0&&Wt&&Wt.push(e),!0}const Hp="3.5.38",Yb=Ht,Qb=cv,Xb=Ea,ey=zf,ty={createComponentInstance:Dp,setupComponent:Pp,renderComponentRoot:Cl,setCurrentRenderingInstance:Fi,isVNode:Cn,normalizeVNode:fs,getComponentPublicInstance:sl,ensureValidVNode:pc,pushWarningContext:iv,popWarningContext:lv},sy=ty,ny=null,ay=null,iy=null;/** +**/const Fp=[];function iv(e){Fp.push(e)}function lv(){Fp.pop()}function rv(e,t){}const ov={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},cv={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function ti(e,t,s,n){try{return n?e(...n):e()}catch(a){pa(a,t,s)}}function xs(e,t,s,n){if(Ie(e)){const a=ti(e,t,s,n);return a&&Yo(a)&&a.catch(i=>{pa(i,t,s)}),a}if(ye(e)){const a=[];for(let i=0;i>>1,a=ts[n],i=Pi(a);i=Pi(s)?ts.push(e):ts.splice(uv(t),0,e),e.flags|=1,Up()}}function Up(){Fl||(Fl=$p.then(Bp))}function Mi(e){ye(e)?Pa.push(...e):Mn&&e.id===-1?Mn.splice(Ca+1,0,e):e.flags&1||(Pa.push(e),e.flags|=1),Up()}function ud(e,t,s=Ys+1){for(;sPi(s)-Pi(n));if(Pa.length=0,Mn){Mn.push(...t);return}for(Mn=t,Ca=0;Cae.id==null?e.flags&2?-1:1/0:e.id;function Bp(e){try{for(Ys=0;YsEa.emit(a,...i)),pl=[]):typeof window<"u"&&window.HTMLElement&&!((n=(s=window.navigator)==null?void 0:s.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{Hp(i,t)}),setTimeout(()=>{Ea||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,pl=[])},3e3)):pl=[]}let Bt=null,xr=null;function Fi(e){const t=Bt;return Bt=e,xr=e&&e.type.__scopeId||null,t}function pv(e){xr=e}function fv(){xr=null}const hv=e=>lc;function lc(e,t=Bt,s){if(!t||e._n)return e;const n=(...a)=>{n._d&&Hi(-1);const i=Fi(t);let l;try{l=e(...a)}finally{Fi(i),n._d&&Hi(1)}return l};return n._n=!0,n._c=!0,n._d=!0,n}function mv(e,t){if(Bt===null)return e;const s=sl(Bt),n=e.dirs||(e.dirs=[]);for(let a=0;a1)return s&&Ie(t)?t.call(n&&n.proxy):t}}function gv(){return!!(as()||ta)}const zp=Symbol.for("v-scx"),Vp=()=>Os(zp);function vv(e,t){return Xi(e,null,t)}function bv(e,t){return Xi(e,null,{flush:"post"})}function jp(e,t){return Xi(e,null,{flush:"sync"})}function ns(e,t,s){return Xi(e,t,s)}function Xi(e,t,s=je){const{immediate:n,deep:a,flush:i,once:l}=s,r=ze({},s),o=t&&n||!t&&i!=="post";let c;if(la){if(i==="sync"){const f=Vp();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!o){const f=()=>{};return f.stop=Ht,f.resume=Ht,f.pause=Ht,f}}const d=Ut;r.call=(f,b,y)=>xs(f,d,b,y);let u=!1;i==="post"?r.scheduler=f=>{kt(f,d&&d.suspense)}:i!=="sync"&&(u=!0,r.scheduler=(f,b)=>{b?f():ic(f)}),r.augmentJob=f=>{t&&(f.flags|=4),u&&(f.flags|=2,d&&(f.id=d.uid,f.i=d))};const p=av(e,t,r);return la&&(c?c.push(p):o&&p()),p}function yv(e,t,s){const n=this.proxy,a=Me(e)?e.includes(".")?qp(n,e):()=>n[e]:e.bind(n,n);let i;Ie(t)?i=t:(i=t.handler,s=t);const l=si(this),r=Xi(a,i.bind(n),s);return l(),r}function qp(e,t){const s=t.split(".");return()=>{let n=e;for(let a=0;ae.__isTeleport,Jn=e=>e&&(e.disabled||e.disabled===""),xv=e=>e&&(e.defer||e.defer===""),pd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,fd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,bo=(e,t)=>{const s=e&&e.to;return Me(s)?t?t(s):null:s},_v={name:"Teleport",__isTeleport:!0,process(e,t,s,n,a,i,l,r,o,c){const{mc:d,pc:u,pbc:p,o:{insert:f,querySelector:b,createText:y,createComment:E,parentNode:O}}=c,x=Jn(t.props);let{dynamicChildren:m}=t;const _=(w,T,C)=>{w.shapeFlag&16&&d(w.children,T,C,a,i,l,r,o)},S=(w=t)=>{const T=Jn(w.props),C=w.target=bo(w.props,b),M=yo(C,w,y,f);C&&(l!=="svg"&&pd(C)?l="svg":l!=="mathml"&&fd(C)&&(l="mathml"),a&&a.isCE&&(a.ce._teleportTargets||(a.ce._teleportTargets=new Set)).add(C),T||(_(w,C,M),gi(w,!1)))},g=w=>{const T=()=>{if(Nn.get(w)===T){if(Nn.delete(w),Jn(w.props)){const C=O(w.el)||s;_(w,C,w.anchor),gi(w,!0)}S(w)}};Nn.set(w,T),kt(T,i)};if(e==null){const w=t.el=y(""),T=t.anchor=y("");if(f(w,s,n),f(T,s,n),xv(t.props)||i&&i.pendingBranch){g(t);return}x&&(_(t,s,T),gi(t,!0)),S()}else{t.el=e.el;const w=t.anchor=e.anchor,T=Nn.get(e);if(T){T.flags|=8,Nn.delete(e),g(t);return}t.targetStart=e.targetStart;const C=t.target=e.target,M=t.targetAnchor=e.targetAnchor,H=Jn(e.props),P=H?s:C,R=H?w:M;if(l==="svg"||pd(C)?l="svg":(l==="mathml"||fd(C))&&(l="mathml"),m?(p(e.dynamicChildren,m,P,a,i,l,r),vc(e,t,!0)):o||u(e,t,P,R,a,i,l,r,!1),x)H?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):fl(t,s,w,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const V=t.target=bo(t.props,b);V&&fl(t,V,null,c,0)}else H&&fl(t,C,M,c,1);gi(t,x)}},remove(e,t,s,{um:n,o:{remove:a}},i){const{shapeFlag:l,children:r,anchor:o,targetStart:c,targetAnchor:d,target:u,props:p}=e,f=i||!Jn(p),b=Nn.get(e);if(b&&(b.flags|=8,Nn.delete(e)),u&&(a(c),a(d)),i&&a(o),!b&&l&16)for(let y=0;y{e.isMounted=!0}),Sr(()=>{e.isUnmounting=!0}),e}const Es=[Function,Array],oc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Es,onEnter:Es,onAfterEnter:Es,onEnterCancelled:Es,onBeforeLeave:Es,onLeave:Es,onAfterLeave:Es,onLeaveCancelled:Es,onBeforeAppear:Es,onAppear:Es,onAfterAppear:Es,onAppearCancelled:Es},Wp=e=>{const t=e.subTree;return t.component?Wp(t.component):t},Sv={name:"BaseTransition",props:oc,setup(e,{slots:t}){const s=as(),n=rc();return()=>{const a=t.default&&_r(t.default(),!0),i=a&&a.length?Zp(a):s.subTree?Nf():void 0;if(!i)return;const l=Je(e),{mode:r}=l;if(n.isLeaving)return jr(i);const o=hd(i);if(!o)return jr(i);let c=Va(o,l,n,s,u=>c=u);o.type!==yt&&Tn(o,c);let d=s.subTree&&hd(s.subTree);if(d&&d.type!==yt&&!Hs(d,o)&&Wp(s).type!==yt){let u=Va(d,l,n,s);if(Tn(d,u),r==="out-in"&&o.type!==yt)return n.isLeaving=!0,u.afterLeave=()=>{n.isLeaving=!1,s.job.flags&8||s.update(),delete u.afterLeave,d=void 0},jr(i);r==="in-out"&&o.type!==yt?u.delayLeave=(p,f,b)=>{const y=Yp(n,d);y[String(d.key)]=d,p[As]=()=>{f(),p[As]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{b(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function Zp(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==yt){t=s;break}}return t}const Jp=Sv;function Yp(e,t){const{leavingVNodes:s}=e;let n=s.get(t.type);return n||(n=Object.create(null),s.set(t.type,n)),n}function Va(e,t,s,n,a){const{appear:i,mode:l,persisted:r=!1,onBeforeEnter:o,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:p,onLeave:f,onAfterLeave:b,onLeaveCancelled:y,onBeforeAppear:E,onAppear:O,onAfterAppear:x,onAppearCancelled:m}=t,_=String(e.key),S=Yp(s,e),g=(C,M)=>{C&&xs(C,n,9,M)},w=(C,M)=>{const H=M[1];g(C,M),ye(C)?C.every(P=>P.length<=1)&&H():C.length<=1&&H()},T={mode:l,persisted:r,beforeEnter(C){let M=o;if(!s.isMounted)if(i)M=E||o;else return;C[As]&&C[As](!0);const H=S[_];H&&Hs(e,H)&&H.el[As]&&H.el[As](),g(M,[C])},enter(C){if(S[_]===e)return;let M=c,H=d,P=u;if(!s.isMounted)if(i)M=O||c,H=x||d,P=m||u;else return;let R=!1;C[oi]=Q=>{R||(R=!0,Q?g(P,[C]):g(H,[C]),T.delayedLeave&&T.delayedLeave(),C[oi]=void 0)};const V=C[oi].bind(null,!1);M?w(M,[C,V]):V()},leave(C,M){const H=String(e.key);if(C[oi]&&C[oi](!0),s.isUnmounting)return M();g(p,[C]);let P=!1;C[As]=V=>{P||(P=!0,M(),V?g(y,[C]):g(b,[C]),C[As]=void 0,S[H]===e&&delete S[H])};const R=C[As].bind(null,!1);S[H]=e,f?w(f,[C,R]):R()},clone(C){const M=Va(C,t,s,n,a);return a&&a(M),M}};return T}function jr(e){if(tl(e))return e=sn(e),e.children=null,e}function hd(e){if(!tl(e))return Kp(e.type)&&e.children?Zp(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&Ie(s.default))return s.default()}}function Tn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Tn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _r(e,t=!1,s){let n=[],a=0;for(let i=0;i1)for(let i=0;is.value,set:i=>s.value=i})}return s}function md(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Ul=new WeakMap;function Fa(e,t,s,n,a=!1){if(ye(e)){e.forEach((y,E)=>Fa(y,t&&(ye(t)?t[E]:t),s,n,a));return}if(xn(n)&&!a){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Fa(e,t,s,n.component.subTree);return}const i=n.shapeFlag&4?sl(n.component):n.el,l=a?null:i,{i:r,r:o}=e,c=t&&t.r,d=r.refs===je?r.refs={}:r.refs,u=r.setupState,p=Je(u),f=u===je?Ia:y=>md(d,y)?!1:tt(p,y),b=(y,E)=>!(E&&md(d,E));if(c!=null&&c!==o){if(gd(t),Me(c))d[c]=null,f(c)&&(u[c]=null);else if(St(c)){const y=t;b(c,y.k)&&(c.value=null),y.k&&(d[y.k]=null)}}if(Ie(o))ti(o,r,12,[l,d]);else{const y=Me(o),E=St(o);if(y||E){const O=()=>{if(e.f){const x=y?f(o)?u[o]:d[o]:b()||!e.k?o.value:d[e.k];if(a)ye(x)&&Jo(x,i);else if(ye(x))x.includes(i)||x.push(i);else if(y)d[o]=[i],f(o)&&(u[o]=d[o]);else{const m=[i];b(o,e.k)&&(o.value=m),e.k&&(d[e.k]=m)}}else y?(d[o]=l,f(o)&&(u[o]=l)):E&&(b(o,e.k)&&(o.value=l),e.k&&(d[e.k]=l))};if(l){const x=()=>{O(),Ul.delete(e)};x.id=-1,Ul.set(e,x),kt(x,s)}else gd(e),O()}}}function gd(e){const t=Ul.get(e);t&&(t.flags|=8,Ul.delete(e))}let vd=!1;const _a=()=>{vd||(console.error("Hydration completed but contains mismatches."),vd=!0)},Ev=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Av=e=>e.namespaceURI.includes("MathML"),hl=e=>{if(e.nodeType===1){if(Ev(e))return"svg";if(Av(e))return"mathml"}},Oa=e=>e.nodeType===8;function Rv(e){const{mt:t,p:s,o:{patchProp:n,createText:a,nextSibling:i,parentNode:l,remove:r,insert:o,createComment:c}}=e,d=(m,_)=>{if(!_.hasChildNodes()){s(null,m,_),$l(),_._vnode=m;return}u(_.firstChild,m,null,null,null),$l(),_._vnode=m},u=(m,_,S,g,w,T=!1)=>{T=T||!!_.dynamicChildren;const C=Oa(m)&&m.data==="[",M=()=>y(m,_,S,g,w,C),{type:H,ref:P,shapeFlag:R,patchFlag:V}=_;let Q=m.nodeType;_.el=m,V===-2&&(T=!1,_.dynamicChildren=null);let U=null;switch(H){case $n:Q!==3?_.children===""?(o(_.el=a(""),l(m),m),U=m):U=M():(m.data!==_.children&&(_a(),m.data=_.children),U=i(m));break;case yt:x(m)?(U=i(m),O(_.el=m.content.firstChild,m,S)):Q!==8||C?U=M():U=i(m);break;case sa:if(C&&(m=i(m),Q=m.nodeType),Q===1||Q===3){U=m;const N=!_.children.length;for(let I=0;I<_.staticCount;I++)N&&(_.children+=U.nodeType===1?U.outerHTML:U.data),I===_.staticCount-1&&(_.anchor=U),U=i(U);return C?i(U):U}else M();break;case Dt:C?U=b(m,_,S,g,w,T):U=M();break;default:if(R&1)(Q!==1||_.type.toLowerCase()!==m.tagName.toLowerCase())&&!x(m)?U=M():U=p(m,_,S,g,w,T);else if(R&6){_.slotScopeIds=w;const N=l(m);if(C?U=E(m):Oa(m)&&m.data==="teleport start"?U=E(m,m.data,"teleport end"):U=i(m),t(_,N,null,S,g,hl(N),T),xn(_)&&!_.type.__asyncResolved){let I;C?(I=pt(Dt),I.anchor=U?U.previousSibling:N.lastChild):I=m.nodeType===3?yc(""):pt("div"),I.el=m,_.component.subTree=I}}else R&64?Q!==8?U=M():U=_.type.hydrate(m,_,S,g,w,T,e,f):R&128&&(U=_.type.hydrate(m,_,S,g,hl(l(m)),w,T,e,u))}return P!=null&&Fa(P,null,g,_),U},p=(m,_,S,g,w,T)=>{T=T||!!_.dynamicChildren;const{type:C,props:M,patchFlag:H,shapeFlag:P,dirs:R,transition:V}=_,Q=C==="input"||C==="option";if(Q||H!==-1){R&&Qs(_,null,S,"created");let U=!1;if(x(m)){U=wf(null,V)&&S&&S.vnode.props&&S.vnode.props.appear;const I=m.content.firstChild;if(U){const Y=I.getAttribute("class");Y&&(I.$cls=Y),V.beforeEnter(I)}O(I,m,S),_.el=m=I}if(P&16&&!(M&&(M.innerHTML||M.textContent))){let I=f(m.firstChild,_,m,S,g,w,T);for(I&&!ml(m,1)&&_a();I;){const Y=I;I=I.nextSibling,r(Y)}}else if(P&8){let I=_.children;I[0]===` +`&&(m.tagName==="PRE"||m.tagName==="TEXTAREA")&&(I=I.slice(1));const{textContent:Y}=m;Y!==I&&Y!==I.replace(/\r\n|\r/g,` +`)&&(ml(m,0)||_a(),m.textContent=_.children)}if(M){if(Q||!T||H&48){const I=m.tagName.includes("-");for(const Y in M)(Q&&(Y.endsWith("value")||Y==="indeterminate")||ca(Y)&&!bn(Y)||Y[0]==="."||I&&!bn(Y))&&n(m,Y,null,M[Y],void 0,S)}else if(M.onClick)n(m,"onClick",null,M.onClick,void 0,S);else if(H&4&&yn(M.style))for(const I in M.style)M.style[I]}let N;(N=M&&M.onVnodeBeforeMount)&&ds(N,S,_),R&&Qs(_,null,S,"beforeMount"),((N=M&&M.onVnodeMounted)||R||U)&&Ef(()=>{N&&ds(N,S,_),U&&V.enter(m),R&&Qs(_,null,S,"mounted")},g)}return m.nextSibling},f=(m,_,S,g,w,T,C)=>{C=C||!!_.dynamicChildren;const M=_.children,H=M.length;let P=!1;for(let R=0;R{const{slotScopeIds:C}=_;C&&(w=w?w.concat(C):C);const M=l(m),H=f(i(m),_,M,S,g,w,T);return H&&Oa(H)&&H.data==="]"?i(_.anchor=H):(_a(),o(_.anchor=c("]"),M,H),H)},y=(m,_,S,g,w,T)=>{if(ml(m.parentElement,1)||_a(),_.el=null,T){const H=E(m);for(;;){const P=i(m);if(P&&P!==H)r(P);else break}}const C=i(m),M=l(m);return r(m),s(null,_,M,C,S,g,hl(M),w),S&&(S.vnode.el=_.el,Cr(S,_.el)),C},E=(m,_="[",S="]")=>{let g=0;for(;m;)if(m=i(m),m&&Oa(m)&&(m.data===_&&g++,m.data===S)){if(g===0)return i(m);g--}return m},O=(m,_,S)=>{const g=_.parentNode;g&&g.replaceChild(m,_);let w=S;for(;w;)w.vnode.el===_&&(w.vnode.el=w.subTree.el=m),w=w.parent},x=m=>m.nodeType===1&&m.tagName==="TEMPLATE";return[d,u]}const bd="data-allow-mismatch",Iv={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function ml(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(bd);)e=e.parentElement;const s=e&&e.getAttribute(bd);if(s==null)return!1;if(s==="")return!0;{const n=s.split(",");return t===0&&n.includes("children")?!0:n.includes(Iv[t])}}const Ov=hr().requestIdleCallback||(e=>setTimeout(e,1)),Nv=hr().cancelIdleCallback||(e=>clearTimeout(e)),Lv=(e=1e4)=>t=>{const s=Ov(t,{timeout:e});return()=>Nv(s)};function Dv(e){const{top:t,left:s,bottom:n,right:a}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:l}=window;return(t>0&&t0&&n0&&s0&&a(t,s)=>{const n=new IntersectionObserver(a=>{for(const i of a)if(i.isIntersecting){n.disconnect(),t();break}},e);return s(a=>{if(a instanceof Element){if(Dv(a))return t(),n.disconnect(),!1;n.observe(a)}}),()=>n.disconnect()},Pv=e=>t=>{if(e){const s=matchMedia(e);if(s.matches)t();else return s.addEventListener("change",t,{once:!0}),()=>s.removeEventListener("change",t)}},Fv=(e=[])=>(t,s)=>{Me(e)&&(e=[e]);let n=!1;const a=l=>{n||(n=!0,i(),t(),l.target.dispatchEvent(new l.constructor(l.type,l)))},i=()=>{s(l=>{for(const r of e)l.removeEventListener(r,a)})};return s(l=>{for(const r of e)l.addEventListener(r,a,{once:!0})}),i};function $v(e,t){if(Oa(e)&&e.data==="["){let s=1,n=e.nextSibling;for(;n;){if(n.nodeType===1){if(t(n)===!1)break}else if(Oa(n))if(n.data==="]"){if(--s===0)break}else n.data==="["&&s++;n=n.nextSibling}}else t(e)}const xn=e=>!!e.type.__asyncLoader;function Uv(e){Ie(e)&&(e={loader:e});const{loader:t,loadingComponent:s,errorComponent:n,delay:a=200,hydrate:i,timeout:l,suspensible:r=!0,onError:o}=e;let c=null,d,u=0;const p=()=>(u++,c=null,f()),f=()=>{let b;return c||(b=c=t().catch(y=>{if(y=y instanceof Error?y:new Error(String(y)),o)return new Promise((E,O)=>{o(y,()=>E(p()),()=>O(y),u+1)});throw y}).then(y=>b!==c&&c?c:(y&&(y.__esModule||y[Symbol.toStringTag]==="Module")&&(y=y.default),d=y,y)))};return el({name:"AsyncComponentWrapper",__asyncLoader:f,__asyncHydrate(b,y,E){let O=!1;(y.bu||(y.bu=[])).push(()=>O=!0);const x=()=>{O||E()},m=i?()=>{const _=i(x,S=>$v(b,S));_&&(y.bum||(y.bum=[])).push(_)}:x;d?m():f().then(()=>!y.isUnmounted&&m())},get __asyncResolved(){return d},setup(){const b=Ut;if(cc(b),d)return()=>gl(d,b);const y=S=>{c=null,pa(S,b,13,!n)};if(r&&b.suspense||la)return f().then(S=>()=>gl(S,b)).catch(S=>(y(S),()=>n?pt(n,{error:S}):null));const E=h(!1),O=h(),x=h(!!a);let m,_;return xt(()=>{m!=null&&clearTimeout(m),_!=null&&clearTimeout(_)}),a&&(_=setTimeout(()=>{b.isUnmounted||(x.value=!1)},a)),l!=null&&(m=setTimeout(()=>{if(!b.isUnmounted&&!E.value&&!O.value){const S=new Error(`Async component timed out after ${l}ms.`);y(S),O.value=S}},l)),f().then(()=>{b.isUnmounted||(E.value=!0,b.parent&&tl(b.parent.vnode)&&b.parent.update())}).catch(S=>{if(b.isUnmounted){c=null;return}y(S),O.value=S}),()=>{if(E.value&&d)return gl(d,b);if(O.value&&n)return pt(n,{error:O.value});if(s&&!x.value)return gl(s,b)}}})}function gl(e,t){const{ref:s,props:n,children:a,ce:i}=t.vnode,l=pt(e,n,a);return l.ref=s,l.ce=i,delete t.vnode.ce,l}const tl=e=>e.type.__isKeepAlive,Bv={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const s=as(),n=s.ctx;if(!n.renderer)return()=>{const x=t.default&&t.default();return x&&x.length===1?x[0]:x};const a=new Map,i=new Set;let l=null;const r=s.suspense,{renderer:{p:o,m:c,um:d,o:{createElement:u}}}=n,p=u("div");n.activate=(x,m,_,S,g)=>{const w=x.component;c(x,m,_,0,r),o(w.vnode,x,m,_,w,r,S,x.slotScopeIds,g),kt(()=>{w.isDeactivated=!1,w.a&&Ma(w.a);const T=x.props&&x.props.onVnodeMounted;T&&ds(T,w.parent,x)},r)},n.deactivate=x=>{const m=x.component;Hl(m.m),Hl(m.a),c(x,p,null,1,r),kt(()=>{m.da&&Ma(m.da);const _=x.props&&x.props.onVnodeUnmounted;_&&ds(_,m.parent,x),m.isDeactivated=!0},r)};function f(x){qr(x),d(x,s,r,!0)}function b(x){a.forEach((m,_)=>{const S=Ao(xn(m)?m.type.__asyncResolved||{}:m.type);S&&!x(S)&&y(_)})}function y(x){const m=a.get(x);m&&(!l||!Hs(m,l))?f(m):l&&qr(l),a.delete(x),i.delete(x)}ns(()=>[e.include,e.exclude],([x,m])=>{x&&b(_=>vi(x,_)),m&&b(_=>!vi(m,_))},{flush:"post",deep:!0});let E=null;const O=()=>{E!=null&&(zl(s.subTree.type)?kt(()=>{a.set(E,vl(s.subTree))},s.subTree.suspense):a.set(E,vl(s.subTree)))};return We(O),wr(O),Sr(()=>{a.forEach(x=>{const{subTree:m,suspense:_}=s,S=vl(m);if(x.type===S.type&&x.key===S.key){qr(S);const g=S.component.da;g&&kt(g,_);return}f(x)})}),()=>{if(E=null,!t.default)return l=null;const x=t.default(),m=x[0];if(x.length>1)return l=null,x;if(!Cn(m)||!(m.shapeFlag&4)&&!(m.shapeFlag&128))return l=null,m;let _=vl(m);if(_.type===yt)return l=null,_;const S=_.type,g=Ao(xn(_)?_.type.__asyncResolved||{}:S),{include:w,exclude:T,max:C}=e;if(w&&(!g||!vi(w,g))||T&&g&&vi(T,g))return _.shapeFlag&=-257,l=_,m;const M=_.key==null?S:_.key,H=a.get(M);return _.el&&(_=sn(_),m.shapeFlag&128&&(m.ssContent=_)),E=M,H?(_.el=H.el,_.component=H.component,_.transition&&Tn(_,_.transition),_.shapeFlag|=512,i.delete(M),i.add(M)):(i.add(M),C&&i.size>parseInt(C,10)&&y(i.values().next().value)),_.shapeFlag|=256,l=_,zl(m.type)?m:_}}},Hv=Bv;function vi(e,t){return ye(e)?e.some(s=>vi(s,t)):Me(e)?e.split(",").includes(t):Ym(e)?(e.lastIndex=0,e.test(t)):!1}function Ds(e,t){Qp(e,"a",t)}function Ms(e,t){Qp(e,"da",t)}function Qp(e,t,s=Ut){const n=e.__wdc||(e.__wdc=()=>{let a=s;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(kr(t,n,s),s){let a=s.parent;for(;a&&a.parent;)tl(a.parent.vnode)&&zv(n,t,s,a),a=a.parent}}function zv(e,t,s,n){const a=kr(t,e,n,!0);xt(()=>{Jo(n[t],a)},s)}function qr(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function vl(e){return e.shapeFlag&128?e.ssContent:e}function kr(e,t,s=Ut,n=!1){if(s){const a=s[e]||(s[e]=[]),i=t.__weh||(t.__weh=(...l)=>{wn();const r=si(s),o=xs(t,s,e,l);return r(),Sn(),o});return n?a.unshift(i):a.push(i),i}}const En=e=>(t,s=Ut)=>{(!la||e==="sp")&&kr(e,(...n)=>t(...n),s)},Xp=En("bm"),We=En("m"),dc=En("bu"),wr=En("u"),Sr=En("bum"),xt=En("um"),ef=En("sp"),tf=En("rtg"),sf=En("rtc");function nf(e,t=Ut){kr("ec",e,t)}const uc="components",Vv="directives";function jv(e,t){return pc(uc,e,!0,t)||e}const af=Symbol.for("v-ndc");function qv(e){return Me(e)?pc(uc,e,!1)||e:e||af}function Gv(e){return pc(Vv,e)}function pc(e,t,s=!0,n=!1){const a=Bt||Ut;if(a){const i=a.type;if(e===uc){const r=Ao(i,!1);if(r&&(r===t||r===it(t)||r===ua(it(t))))return i}const l=yd(a[e]||i[e],t)||yd(a.appContext[e],t);return!l&&n?i:l}}function yd(e,t){return e&&(e[t]||e[it(t)]||e[ua(it(t))])}function Kv(e,t,s,n){let a;const i=s&&s[n],l=ye(e);if(l||Me(e)){const r=l&&yn(e);let o=!1,c=!1;r&&(o=!ms(e),c=tn(e),e=vr(e)),a=new Array(e.length);for(let d=0,u=e.length;dt(r,o,void 0,i&&i[o]));else{const r=Object.keys(e);a=new Array(r.length);for(let o=0,c=r.length;o{const i=n.fn(...a);return i&&(i.key=n.key),i}:n.fn)}return e}function Zv(e,t,s={},n,a){if(Bt.ce||Bt.parent&&xn(Bt.parent)&&Bt.parent.ce){const c=Object.keys(s).length>0;return t!=="default"&&(s.name=t),Bi(),Vl(Dt,null,[pt("slot",s,n&&n())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),Bi();const l=i&&fc(i(s)),r=s.key||l&&l.key,o=Vl(Dt,{key:(r&&!Jt(r)?r:`_${t}`)+(!l&&n?"_fb":"")},l||(n?n():[]),l&&e._===1?64:-2);return!a&&o.scopeId&&(o.slotScopeIds=[o.scopeId+"-s"]),i&&i._c&&(i._d=!0),o}function fc(e){return e.some(t=>Cn(t)?!(t.type===yt||t.type===Dt&&!fc(t.children)):!0)?e:null}function Jv(e,t){const s={};for(const n in e)s[t&&/[A-Z]/.test(n)?`on:${n}`:Da(n)]=e[n];return s}const xo=e=>e?Mf(e)?sl(e):xo(e.parent):null,Si=ze(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>xo(e.parent),$root:e=>xo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>hc(e),$forceUpdate:e=>e.f||(e.f=()=>{ic(e.update)}),$nextTick:e=>e.n||(e.n=Rt.bind(e.proxy)),$watch:e=>yv.bind(e)}),Gr=(e,t)=>e!==je&&!e.__isScriptSetup&&tt(e,t),_o={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:a,props:i,accessCache:l,type:r,appContext:o}=e;if(t[0]!=="$"){const p=l[t];if(p!==void 0)switch(p){case 1:return n[t];case 2:return a[t];case 4:return s[t];case 3:return i[t]}else{if(Gr(n,t))return l[t]=1,n[t];if(a!==je&&tt(a,t))return l[t]=2,a[t];if(tt(i,t))return l[t]=3,i[t];if(s!==je&&tt(s,t))return l[t]=4,s[t];ko&&(l[t]=0)}}const c=Si[t];let d,u;if(c)return t==="$attrs"&&Kt(e.attrs,"get",""),c(e);if((d=r.__cssModules)&&(d=d[t]))return d;if(s!==je&&tt(s,t))return l[t]=4,s[t];if(u=o.config.globalProperties,tt(u,t))return u[t]},set({_:e},t,s){const{data:n,setupState:a,ctx:i}=e;return Gr(a,t)?(a[t]=s,!0):n!==je&&tt(n,t)?(n[t]=s,!0):tt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:a,props:i,type:l}},r){let o;return!!(s[r]||e!==je&&r[0]!=="$"&&tt(e,r)||Gr(t,r)||tt(i,r)||tt(n,r)||tt(Si,r)||tt(a.config.globalProperties,r)||(o=l.__cssModules)&&o[r])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:tt(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}},Yv=ze({},_o,{get(e,t){if(t!==Symbol.unscopables)return _o.get(e,t,e)},has(e,t){return t[0]!=="_"&&!ag(t)}});function Qv(){return null}function Xv(){return null}function eb(e){}function tb(e){}function sb(){return null}function nb(){}function ab(e,t){return null}function ib(){return lf().slots}function lb(){return lf().attrs}function lf(e){const t=as();return t.setupContext||(t.setupContext=Uf(t))}function $i(e){return ye(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}function rb(e,t){const s=$i(e);for(const n in t){if(n.startsWith("__skip"))continue;let a=s[n];a?ye(a)||Ie(a)?a=s[n]={type:a,default:t[n]}:a.default=t[n]:a===null&&(a=s[n]={default:t[n]}),a&&t[`__skip_${n}`]&&(a.skipFactory=!0)}return s}function ob(e,t){return!e||!t?e||t:ye(e)&&ye(t)?e.concat(t):ze({},$i(e),$i(t))}function cb(e,t){const s={};for(const n in e)t.includes(n)||Object.defineProperty(s,n,{enumerable:!0,get:()=>e[n]});return s}function db(e){const t=as(),s=la;let n=e();zi(),s&&Ua(!1);const a=()=>{si(t),s&&Ua(!0)},i=()=>{as()!==t&&t.scope.off(),zi(),s&&Ua(!1)};return Yo(n)&&(n=n.catch(l=>{throw a(),Promise.resolve().then(()=>Promise.resolve().then(i)),l})),[n,()=>{a(),Promise.resolve().then(i)}]}let ko=!0;function ub(e){const t=hc(e),s=e.proxy,n=e.ctx;ko=!1,t.beforeCreate&&xd(t.beforeCreate,e,"bc");const{data:a,computed:i,methods:l,watch:r,provide:o,inject:c,created:d,beforeMount:u,mounted:p,beforeUpdate:f,updated:b,activated:y,deactivated:E,beforeDestroy:O,beforeUnmount:x,destroyed:m,unmounted:_,render:S,renderTracked:g,renderTriggered:w,errorCaptured:T,serverPrefetch:C,expose:M,inheritAttrs:H,components:P,directives:R,filters:V}=t;if(c&&pb(c,n,null),l)for(const N in l){const I=l[N];Ie(I)&&(n[N]=I.bind(s))}if(a){const N=a.call(s,s);Xe(N)&&(e.data=Hn(N))}if(ko=!0,i)for(const N in i){const I=i[N],Y=Ie(I)?I.bind(s,s):Ie(I.get)?I.get.bind(s,s):Ht,Se=!Ie(I)&&Ie(I.set)?I.set.bind(s):Ht,we=J({get:Y,set:Se});Object.defineProperty(n,N,{enumerable:!0,configurable:!0,get:()=>we.value,set:re=>we.value=re})}if(r)for(const N in r)rf(r[N],n,s,N);if(o){const N=Ie(o)?o.call(s):o;Reflect.ownKeys(N).forEach(I=>{wi(I,N[I])})}d&&xd(d,e,"c");function U(N,I){ye(I)?I.forEach(Y=>N(Y.bind(s))):I&&N(I.bind(s))}if(U(Xp,u),U(We,p),U(dc,f),U(wr,b),U(Ds,y),U(Ms,E),U(nf,T),U(sf,g),U(tf,w),U(Sr,x),U(xt,_),U(ef,C),ye(M))if(M.length){const N=e.exposed||(e.exposed={});M.forEach(I=>{Object.defineProperty(N,I,{get:()=>s[I],set:Y=>s[I]=Y,enumerable:!0})})}else e.exposed||(e.exposed={});S&&e.render===Ht&&(e.render=S),H!=null&&(e.inheritAttrs=H),P&&(e.components=P),R&&(e.directives=R),C&&cc(e)}function pb(e,t,s=Ht){ye(e)&&(e=wo(e));for(const n in e){const a=e[n];let i;Xe(a)?"default"in a?i=Os(a.from||n,a.default,!0):i=Os(a.from||n):i=Os(a),St(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:l=>i.value=l}):t[n]=i}}function xd(e,t,s){xs(ye(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function rf(e,t,s,n){let a=n.includes(".")?qp(s,n):()=>s[n];if(Me(e)){const i=t[e];Ie(i)&&ns(a,i)}else if(Ie(e))ns(a,e.bind(s));else if(Xe(e))if(ye(e))e.forEach(i=>rf(i,t,s,n));else{const i=Ie(e.handler)?e.handler.bind(s):t[e.handler];Ie(i)&&ns(a,i,e)}}function hc(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:a,optionsCache:i,config:{optionMergeStrategies:l}}=e.appContext,r=i.get(t);let o;return r?o=r:!a.length&&!s&&!n?o=t:(o={},a.length&&a.forEach(c=>Bl(o,c,l,!0)),Bl(o,t,l)),Xe(t)&&i.set(t,o),o}function Bl(e,t,s,n=!1){const{mixins:a,extends:i}=t;i&&Bl(e,i,s,!0),a&&a.forEach(l=>Bl(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const r=fb[l]||s&&s[l];e[l]=r?r(e[l],t[l]):t[l]}return e}const fb={data:_d,props:kd,emits:kd,methods:bi,computed:bi,beforeCreate:Qt,created:Qt,beforeMount:Qt,mounted:Qt,beforeUpdate:Qt,updated:Qt,beforeDestroy:Qt,beforeUnmount:Qt,destroyed:Qt,unmounted:Qt,activated:Qt,deactivated:Qt,errorCaptured:Qt,serverPrefetch:Qt,components:bi,directives:bi,watch:mb,provide:_d,inject:hb};function _d(e,t){return t?e?function(){return ze(Ie(e)?e.call(this,this):e,Ie(t)?t.call(this,this):t)}:t:e}function hb(e,t){return bi(wo(e),wo(t))}function wo(e){if(ye(e)){const t={};for(let s=0;s{let d,u=je,p;return jp(()=>{const f=e[a];Lt(d,f)&&(d=f,c())}),{get(){return o(),s.get?s.get(d):d},set(f){const b=s.set?s.set(f):f;if(!Lt(b,d)&&!(u!==je&&Lt(f,u)))return;const y=n.vnode.props,E=!!(y&&(t in y||a in y||i in y)&&(`onUpdate:${t}`in y||`onUpdate:${a}`in y||`onUpdate:${i}`in y));E||(d=f,c()),n.emit(`update:${t}`,b),Lt(f,u)&&(Lt(f,b)&&!Lt(b,p)||E&&u!==je&&!Lt(b,d))&&c(),u=f,p=b}}});return r[Symbol.iterator]=()=>{let o=0;return{next(){return o<2?{value:o++?l||je:r,done:!1}:{done:!0}}}},r}const cf=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${it(t)}Modifiers`]||e[`${fs(t)}Modifiers`];function yb(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||je;let a=s;const i=t.startsWith("update:"),l=i&&cf(n,t.slice(7));l&&(l.trim&&(a=s.map(d=>Me(d)?d.trim():d)),l.number&&(a=s.map(fr)));let r,o=n[r=Da(t)]||n[r=Da(it(t))];!o&&i&&(o=n[r=Da(fs(t))]),o&&xs(o,e,6,a);const c=n[r+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,xs(c,e,6,a)}}const xb=new WeakMap;function df(e,t,s=!1){const n=s?xb:t.emitsCache,a=n.get(e);if(a!==void 0)return a;const i=e.emits;let l={},r=!1;if(!Ie(e)){const o=c=>{const d=df(c,t,!0);d&&(r=!0,ze(l,d))};!s&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return!i&&!r?(Xe(e)&&n.set(e,null),null):(ye(i)?i.forEach(o=>l[o]=null):ze(l,i),Xe(e)&&n.set(e,l),l)}function Tr(e,t){return!e||!ca(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,fs(t))||tt(e,t))}function Cl(e){const{type:t,vnode:s,proxy:n,withProxy:a,propsOptions:[i],slots:l,attrs:r,emit:o,render:c,renderCache:d,props:u,data:p,setupState:f,ctx:b,inheritAttrs:y}=e,E=Fi(e);let O,x;try{if(s.shapeFlag&4){const _=a||n,S=_;O=ps(c.call(S,_,d,u,f,p,b)),x=r}else{const _=t;O=ps(_.length>1?_(u,{attrs:r,slots:l,emit:o}):_(u,null)),x=t.props?r:kb(r)}}catch(_){Ti.length=0,pa(_,e,1),O=pt(yt)}let m=O;if(x&&y!==!1){const _=Object.keys(x),{shapeFlag:S}=m;_.length&&S&7&&(i&&_.some(cr)&&(x=wb(x,i)),m=sn(m,x,!1,!0))}return s.dirs&&(m=sn(m,null,!1,!0),m.dirs=m.dirs?m.dirs.concat(s.dirs):s.dirs),s.transition&&Tn(m,s.transition),O=m,Fi(E),O}function _b(e,t=!0){let s;for(let n=0;n{let t;for(const s in e)(s==="class"||s==="style"||ca(s))&&((t||(t={}))[s]=e[s]);return t},wb=(e,t)=>{const s={};for(const n in e)(!cr(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Sb(e,t,s){const{props:n,children:a,component:i}=e,{props:l,children:r,patchFlag:o}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&o>=0){if(o&1024)return!0;if(o&16)return n?wd(n,l,c):!!l;if(o&8){const d=t.dynamicProps;for(let u=0;uObject.create(pf),hf=e=>Object.getPrototypeOf(e)===pf;function Tb(e,t,s,n=!1){const a={},i=ff();e.propsDefaults=Object.create(null),mf(e,t,a,i);for(const l in e.propsOptions[0])l in a||(a[l]=void 0);s?e.props=n?a:sc(a):e.type.props?e.props=a:e.props=i,e.attrs=i}function Cb(e,t,s,n){const{props:a,attrs:i,vnode:{patchFlag:l}}=e,r=Je(a),[o]=e.propsOptions;let c=!1;if((n||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let u=0;u{o=!0;const[p,f]=gf(u,t,!0);ze(l,p),f&&r.push(...f)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!o)return Xe(e)&&n.set(e,Na),Na;if(ye(i))for(let d=0;de==="_"||e==="_ctx"||e==="$stable",gc=e=>ye(e)?e.map(ps):[ps(e)],Ab=(e,t,s)=>{if(t._n)return t;const n=lc((...a)=>gc(t(...a)),s);return n._c=!1,n},vf=(e,t,s)=>{const n=e._ctx;for(const a in e){if(mc(a))continue;const i=e[a];if(Ie(i))t[a]=Ab(a,i,n);else if(i!=null){const l=gc(i);t[a]=()=>l}}},bf=(e,t)=>{const s=gc(t);e.slots.default=()=>s},yf=(e,t,s)=>{for(const n in t)(s||!mc(n))&&(e[n]=t[n])},Rb=(e,t,s)=>{const n=e.slots=ff();if(e.vnode.shapeFlag&32){const a=t._;a?(yf(n,t,s),s&&dp(n,"_",a,!0)):vf(t,n)}else t&&bf(e,t)},Ib=(e,t,s)=>{const{vnode:n,slots:a}=e;let i=!0,l=je;if(n.shapeFlag&32){const r=t._;r?s&&r===1?i=!1:yf(a,t,s):(i=!t.$stable,vf(t,a)),l=t}else t&&(bf(e,t),l={default:1});if(i)for(const r in a)!mc(r)&&l[r]==null&&delete a[r]},kt=Ef;function xf(e){return kf(e)}function _f(e){return kf(e,Rv)}function kf(e,t){const s=hr();s.__VUE__=!0;const{insert:n,remove:a,patchProp:i,createElement:l,createText:r,createComment:o,setText:c,setElementText:d,parentNode:u,nextSibling:p,setScopeId:f=Ht,insertStaticContent:b}=e,y=(k,L,F,ee=null,Z=null,X=null,ue=void 0,de=null,oe=!!L.dynamicChildren)=>{if(k===L)return;k&&!Hs(k,L)&&(ee=B(k),re(k,Z,X,!0),k=null),L.patchFlag===-2&&(oe=!1,L.dynamicChildren=null);const{type:te,ref:ne,shapeFlag:pe}=L;switch(te){case $n:E(k,L,F,ee);break;case yt:O(k,L,F,ee);break;case sa:k==null&&x(L,F,ee,ue);break;case Dt:P(k,L,F,ee,Z,X,ue,de,oe);break;default:pe&1?S(k,L,F,ee,Z,X,ue,de,oe):pe&6?R(k,L,F,ee,Z,X,ue,de,oe):(pe&64||pe&128)&&te.process(k,L,F,ee,Z,X,ue,de,oe,xe)}ne!=null&&Z?Fa(ne,k&&k.ref,X,L||k,!L):ne==null&&k&&k.ref!=null&&Fa(k.ref,null,X,k,!0)},E=(k,L,F,ee)=>{if(k==null)n(L.el=r(L.children),F,ee);else{const Z=L.el=k.el;L.children!==k.children&&c(Z,L.children)}},O=(k,L,F,ee)=>{k==null?n(L.el=o(L.children||""),F,ee):L.el=k.el},x=(k,L,F,ee)=>{[k.el,k.anchor]=b(k.children,L,F,ee,k.el,k.anchor)},m=({el:k,anchor:L},F,ee)=>{let Z;for(;k&&k!==L;)Z=p(k),n(k,F,ee),k=Z;n(L,F,ee)},_=({el:k,anchor:L})=>{let F;for(;k&&k!==L;)F=p(k),a(k),k=F;a(L)},S=(k,L,F,ee,Z,X,ue,de,oe)=>{if(L.type==="svg"?ue="svg":L.type==="math"&&(ue="mathml"),k==null)g(L,F,ee,Z,X,ue,de,oe);else{const te=k.el&&k.el._isVueCE?k.el:null;try{te&&te._beginPatch(),C(k,L,Z,X,ue,de,oe)}finally{te&&te._endPatch()}}},g=(k,L,F,ee,Z,X,ue,de)=>{let oe,te;const{props:ne,shapeFlag:pe,transition:be,dirs:Te}=k;if(oe=k.el=l(k.type,X,ne&&ne.is,ne),pe&8?d(oe,k.children):pe&16&&T(k.children,oe,null,ee,Z,Kr(k,X),ue,de),Te&&Qs(k,null,ee,"created"),w(oe,k,k.scopeId,ue,ee),ne){for(const Le in ne)Le!=="value"&&!bn(Le)&&i(oe,Le,null,ne[Le],X,ee);"value"in ne&&i(oe,"value",null,ne.value,X),(te=ne.onVnodeBeforeMount)&&ds(te,ee,k)}Te&&Qs(k,null,ee,"beforeMount");const Oe=wf(Z,be);Oe&&be.beforeEnter(oe),n(oe,L,F),((te=ne&&ne.onVnodeMounted)||Oe||Te)&&kt(()=>{try{te&&ds(te,ee,k),Oe&&be.enter(oe),Te&&Qs(k,null,ee,"mounted")}finally{}},Z)},w=(k,L,F,ee,Z)=>{if(F&&f(k,F),ee)for(let X=0;X{for(let te=oe;te{const de=L.el=k.el;let{patchFlag:oe,dynamicChildren:te,dirs:ne}=L;oe|=k.patchFlag&16;const pe=k.props||je,be=L.props||je;let Te;if(F&&qn(F,!1),(Te=be.onVnodeBeforeUpdate)&&ds(Te,F,L,k),ne&&Qs(L,k,F,"beforeUpdate"),F&&qn(F,!0),(pe.innerHTML&&be.innerHTML==null||pe.textContent&&be.textContent==null)&&d(de,""),te?M(k.dynamicChildren,te,de,F,ee,Kr(L,Z),X):ue||I(k,L,de,null,F,ee,Kr(L,Z),X,!1),oe>0){if(oe&16)H(de,pe,be,F,Z);else if(oe&2&&pe.class!==be.class&&i(de,"class",null,be.class,Z),oe&4&&i(de,"style",pe.style,be.style,Z),oe&8){const Oe=L.dynamicProps;for(let Le=0;Le{Te&&ds(Te,F,L,k),ne&&Qs(L,k,F,"updated")},ee)},M=(k,L,F,ee,Z,X,ue)=>{for(let de=0;de{if(L!==F){if(L!==je)for(const X in L)!bn(X)&&!(X in F)&&i(k,X,L[X],null,Z,ee);for(const X in F){if(bn(X))continue;const ue=F[X],de=L[X];ue!==de&&X!=="value"&&i(k,X,de,ue,Z,ee)}"value"in F&&i(k,"value",L.value,F.value,Z)}},P=(k,L,F,ee,Z,X,ue,de,oe)=>{const te=L.el=k?k.el:r(""),ne=L.anchor=k?k.anchor:r("");let{patchFlag:pe,dynamicChildren:be,slotScopeIds:Te}=L;Te&&(de=de?de.concat(Te):Te),k==null?(n(te,F,ee),n(ne,F,ee),T(L.children||[],F,ne,Z,X,ue,de,oe)):pe>0&&pe&64&&be&&k.dynamicChildren&&k.dynamicChildren.length===be.length?(M(k.dynamicChildren,be,F,Z,X,ue,de),(L.key!=null||Z&&L===Z.subTree)&&vc(k,L,!0)):I(k,L,F,ne,Z,X,ue,de,oe)},R=(k,L,F,ee,Z,X,ue,de,oe)=>{L.slotScopeIds=de,k==null?L.shapeFlag&512?Z.ctx.activate(L,F,ee,ue,oe):V(L,F,ee,Z,X,ue,oe):Q(k,L,oe)},V=(k,L,F,ee,Z,X,ue)=>{const de=k.component=Df(k,ee,Z);if(tl(k)&&(de.ctx.renderer=xe),Pf(de,!1,ue),de.asyncDep){if(Z&&Z.registerDep(de,U,ue),!k.el){const oe=de.subTree=pt(yt);O(null,oe,L,F),k.placeholder=oe.el}}else U(de,k,L,F,Z,X,ue)},Q=(k,L,F)=>{const ee=L.component=k.component;if(Sb(k,L,F))if(ee.asyncDep&&!ee.asyncResolved){N(ee,L,F);return}else ee.next=L,ee.update();else L.el=k.el,ee.vnode=L},U=(k,L,F,ee,Z,X,ue)=>{const de=()=>{if(k.isMounted){let{next:pe,bu:be,u:Te,parent:Oe,vnode:Le}=k;{const G=Sf(k);if(G){pe&&(pe.el=Le.el,N(k,pe,ue)),G.asyncDep.then(()=>{kt(()=>{k.isUnmounted||te()},Z)});return}}let De=pe,Be;qn(k,!1),pe?(pe.el=Le.el,N(k,pe,ue)):pe=Le,be&&Ma(be),(Be=pe.props&&pe.props.onVnodeBeforeUpdate)&&ds(Be,Oe,pe,Le),qn(k,!0);const qe=Cl(k),ct=k.subTree;k.subTree=qe,y(ct,qe,u(ct.el),B(ct),k,Z,X),pe.el=qe.el,De===null&&Cr(k,qe.el),Te&&kt(Te,Z),(Be=pe.props&&pe.props.onVnodeUpdated)&&kt(()=>ds(Be,Oe,pe,Le),Z)}else{let pe;const{el:be,props:Te}=L,{bm:Oe,m:Le,parent:De,root:Be,type:qe}=k,ct=xn(L);if(qn(k,!1),Oe&&Ma(Oe),!ct&&(pe=Te&&Te.onVnodeBeforeMount)&&ds(pe,De,L),qn(k,!0),be&&Fe){const G=()=>{k.subTree=Cl(k),Fe(be,k.subTree,k,Z,null)};ct&&qe.__asyncHydrate?qe.__asyncHydrate(be,k,G):G()}else{Be.ce&&Be.ce._hasShadowRoot()&&Be.ce._injectChildStyle(qe,k.parent?k.parent.type:void 0);const G=k.subTree=Cl(k);y(null,G,F,ee,k,Z,X),L.el=G.el}if(Le&&kt(Le,Z),!ct&&(pe=Te&&Te.onVnodeMounted)){const G=L;kt(()=>ds(pe,De,G),Z)}(L.shapeFlag&256||De&&xn(De.vnode)&&De.vnode.shapeFlag&256)&&k.a&&kt(k.a,Z),k.isMounted=!0,L=F=ee=null}};k.scope.on();const oe=k.effect=new Ni(de);k.scope.off();const te=k.update=oe.run.bind(oe),ne=k.job=oe.runIfDirty.bind(oe);ne.i=k,ne.id=k.uid,oe.scheduler=()=>ic(ne),qn(k,!0),te()},N=(k,L,F)=>{L.component=k;const ee=k.vnode.props;k.vnode=L,k.next=null,Cb(k,L.props,ee,F),Ib(k,L.children,F),wn(),ud(k),Sn()},I=(k,L,F,ee,Z,X,ue,de,oe=!1)=>{const te=k&&k.children,ne=k?k.shapeFlag:0,pe=L.children,{patchFlag:be,shapeFlag:Te}=L;if(be>0){if(be&128){Se(te,pe,F,ee,Z,X,ue,de,oe);return}else if(be&256){Y(te,pe,F,ee,Z,X,ue,de,oe);return}}Te&8?(ne&16&&W(te,Z,X),pe!==te&&d(F,pe)):ne&16?Te&16?Se(te,pe,F,ee,Z,X,ue,de,oe):W(te,Z,X,!0):(ne&8&&d(F,""),Te&16&&T(pe,F,ee,Z,X,ue,de,oe))},Y=(k,L,F,ee,Z,X,ue,de,oe)=>{k=k||Na,L=L||Na;const te=k.length,ne=L.length,pe=Math.min(te,ne);let be;for(be=0;bene?W(k,Z,X,!0,!1,pe):T(L,F,ee,Z,X,ue,de,oe,pe)},Se=(k,L,F,ee,Z,X,ue,de,oe)=>{let te=0;const ne=L.length;let pe=k.length-1,be=ne-1;for(;te<=pe&&te<=be;){const Te=k[te],Oe=L[te]=oe?un(L[te]):ps(L[te]);if(Hs(Te,Oe))y(Te,Oe,F,null,Z,X,ue,de,oe);else break;te++}for(;te<=pe&&te<=be;){const Te=k[pe],Oe=L[be]=oe?un(L[be]):ps(L[be]);if(Hs(Te,Oe))y(Te,Oe,F,null,Z,X,ue,de,oe);else break;pe--,be--}if(te>pe){if(te<=be){const Te=be+1,Oe=Tebe)for(;te<=pe;)re(k[te],Z,X,!0),te++;else{const Te=te,Oe=te,Le=new Map;for(te=Oe;te<=be;te++){const Re=L[te]=oe?un(L[te]):ps(L[te]);Re.key!=null&&Le.set(Re.key,te)}let De,Be=0;const qe=be-Oe+1;let ct=!1,G=0;const _e=new Array(qe);for(te=0;te=qe){re(Re,Z,X,!0);continue}let Ve;if(Re.key!=null)Ve=Le.get(Re.key);else for(De=Oe;De<=be;De++)if(_e[De-Oe]===0&&Hs(Re,L[De])){Ve=De;break}Ve===void 0?re(Re,Z,X,!0):(_e[Ve-Oe]=te+1,Ve>=G?G=Ve:ct=!0,y(Re,L[Ve],F,null,Z,X,ue,de,oe),Be++)}const Ce=ct?Ob(_e):Na;for(De=Ce.length-1,te=qe-1;te>=0;te--){const Re=Oe+te,Ve=L[Re],Pe=L[Re+1],ft=Re+1{const{el:X,type:ue,transition:de,children:oe,shapeFlag:te}=k;if(te&6){we(k.component.subTree,L,F,ee);return}if(te&128){k.suspense.move(L,F,ee);return}if(te&64){ue.move(k,L,F,xe);return}if(ue===Dt){n(X,L,F);for(let pe=0;pede.enter(X),Z));else{const{leave:pe,delayLeave:be,afterLeave:Te}=de,Oe=()=>{k.ctx.isUnmounted?a(X):n(X,L,F)},Le=()=>{const De=X._isLeaving||!!X[As];X._isLeaving&&X[As](!0),de.persisted&&!De?Oe():pe(X,()=>{Oe(),Te&&Te()})};be?be(X,Oe,Le):Le()}else n(X,L,F)},re=(k,L,F,ee=!1,Z=!1)=>{const{type:X,props:ue,ref:de,children:oe,dynamicChildren:te,shapeFlag:ne,patchFlag:pe,dirs:be,cacheIndex:Te,memo:Oe}=k;if(pe===-2&&(Z=!1),de!=null&&(wn(),Fa(de,null,F,k,!0),Sn()),Te!=null&&(L.renderCache[Te]=void 0),ne&256){L.ctx.deactivate(k);return}const Le=ne&1&&be,De=!xn(k);let Be;if(De&&(Be=ue&&ue.onVnodeBeforeUnmount)&&ds(Be,L,k),ne&6)me(k.component,F,ee);else{if(ne&128){k.suspense.unmount(F,ee);return}Le&&Qs(k,null,L,"beforeUnmount"),ne&64?k.type.remove(k,L,F,xe,ee):te&&!te.hasOnce&&(X!==Dt||pe>0&&pe&64)?W(te,L,F,!1,!0):(X===Dt&&pe&384||!Z&&ne&16)&&W(oe,L,F),ee&&he(k)}const qe=Oe!=null&&Te==null;(De&&(Be=ue&&ue.onVnodeUnmounted)||Le||qe)&&kt(()=>{Be&&ds(Be,L,k),Le&&Qs(k,null,L,"unmounted"),qe&&(k.el=null)},F)},he=k=>{const{type:L,el:F,anchor:ee,transition:Z}=k;if(L===Dt){se(F,ee);return}if(L===sa){_(k);return}const X=()=>{a(F),Z&&!Z.persisted&&Z.afterLeave&&Z.afterLeave()};if(k.shapeFlag&1&&Z&&!Z.persisted){const{leave:ue,delayLeave:de}=Z,oe=()=>ue(F,X);de?de(k.el,X,oe):oe()}else X()},se=(k,L)=>{let F;for(;k!==L;)F=p(k),a(k),k=F;a(L)},me=(k,L,F)=>{const{bum:ee,scope:Z,job:X,subTree:ue,um:de,m:oe,a:te}=k;Hl(oe),Hl(te),ee&&Ma(ee),Z.stop(),X&&(X.flags|=8,re(ue,k,L,F)),de&&kt(de,L),kt(()=>{k.isUnmounted=!0},L)},W=(k,L,F,ee=!1,Z=!1,X=0)=>{for(let ue=X;ue{if(k.shapeFlag&6)return B(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const L=p(k.anchor||k.el),F=L&&L[Gp];return F?p(F):L};let ie=!1;const le=(k,L,F)=>{let ee;k==null?L._vnode&&(re(L._vnode,null,null,!0),ee=L._vnode.component):y(L._vnode||null,k,L,null,null,null,F),L._vnode=k,ie||(ie=!0,ud(ee),$l(),ie=!1)},xe={p:y,um:re,m:we,r:he,mt:V,mc:T,pc:I,pbc:M,n:B,o:e};let ge,Fe;return t&&([ge,Fe]=t(xe)),{render:le,hydrate:ge,createApp:vb(le,ge)}}function Kr({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function qn({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function wf(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function vc(e,t,s=!1){const n=e.children,a=t.children;if(ye(n)&&ye(a))for(let i=0;i>1,e[s[r]]0&&(t[n]=s[i-1]),s[i]=n)}}for(i=s.length,l=s[i-1];i-- >0;)s[i]=l,l=t[l];return s}function Sf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Sf(t)}function Hl(e){if(e)for(let t=0;te.__isSuspense;let To=0;const Nb={name:"Suspense",__isSuspense:!0,process(e,t,s,n,a,i,l,r,o,c){if(e==null)Db(t,s,n,a,i,l,r,o,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Mb(e,t,s,n,a,l,r,o,c)}},hydrate:Pb,normalize:Fb},Lb=Nb;function Ui(e,t){const s=e.props&&e.props[t];Ie(s)&&s()}function Db(e,t,s,n,a,i,l,r,o){const{p:c,o:{createElement:d}}=o,u=d("div"),p=e.suspense=Cf(e,a,n,t,u,s,i,l,r,o);c(null,p.pendingBranch=e.ssContent,u,null,n,p,i,l),p.deps>0?(Ui(e,"onPending"),Ui(e,"onFallback"),c(null,e.ssFallback,t,s,n,null,i,l),$a(p,e.ssFallback)):p.resolve(!1,!0)}function Mb(e,t,s,n,a,i,l,r,{p:o,um:c,o:{createElement:d}}){const u=t.suspense=e.suspense;u.vnode=t,t.el=e.el;const p=t.ssContent,f=t.ssFallback,{activeBranch:b,pendingBranch:y,isInFallback:E,isHydrating:O}=u;if(y)u.pendingBranch=p,Hs(y,p)?(o(y,p,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0?u.resolve():E&&(O||(o(b,f,s,n,a,null,i,l,r),$a(u,f)))):(u.pendingId=To++,O?(u.isHydrating=!1,u.activeBranch=y):c(y,a,u),u.deps=0,u.effects.length=0,u.hiddenContainer=d("div"),E?(o(null,p,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0?u.resolve():(o(b,f,s,n,a,null,i,l,r),$a(u,f))):b&&Hs(b,p)?(o(b,p,s,n,a,u,i,l,r),u.resolve(!0)):(o(null,p,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0&&u.resolve()));else if(b&&Hs(b,p))o(b,p,s,n,a,u,i,l,r),$a(u,p);else if(Ui(t,"onPending"),u.pendingBranch=p,p.shapeFlag&512?u.pendingId=p.component.suspenseId:u.pendingId=To++,o(null,p,u.hiddenContainer,null,a,u,i,l,r),u.deps<=0)u.resolve();else{const{timeout:x,pendingId:m}=u;x>0?setTimeout(()=>{u.pendingId===m&&u.fallback(f)},x):x===0&&u.fallback(f)}}function Cf(e,t,s,n,a,i,l,r,o,c,d=!1){const{p:u,m:p,um:f,n:b,o:{parentNode:y,remove:E}}=c;let O;const x=$b(e);x&&t&&t.pendingBranch&&(O=t.pendingId,t.deps++);const m=e.props?Ll(e.props.timeout):void 0,_=i,S={vnode:e,parent:t,parentComponent:s,namespace:l,container:n,hiddenContainer:a,deps:0,pendingId:To++,timeout:typeof m=="number"?m:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(g=!1,w=!1){const{vnode:T,activeBranch:C,pendingBranch:M,pendingId:H,effects:P,parentComponent:R,container:V,isInFallback:Q}=S;let U=!1;if(S.isHydrating)S.isHydrating=!1;else if(!g){U=C&&M.transition&&M.transition.mode==="out-in";let Y=!1;U&&(C.transition.afterLeave=()=>{H===S.pendingId&&(p(M,V,i===_&&!Y?b(C):i,0),Mi(P),Q&&T.ssFallback&&(T.ssFallback.el=null))}),C&&!S.isFallbackMountPending&&(y(C.el)===V&&(i=b(C),Y=!0),f(C,R,S,!0),!U&&Q&&T.ssFallback&&kt(()=>T.ssFallback.el=null,S)),U||p(M,V,i,0)}S.isFallbackMountPending=!1,$a(S,M),S.pendingBranch=null,S.isInFallback=!1;let N=S.parent,I=!1;for(;N;){if(N.pendingBranch){N.effects.push(...P),I=!0;break}N=N.parent}!I&&!U&&Mi(P),S.effects=[],x&&t&&t.pendingBranch&&O===t.pendingId&&(t.deps--,t.deps===0&&!w&&t.resolve()),Ui(T,"onResolve")},fallback(g){if(!S.pendingBranch)return;const{vnode:w,activeBranch:T,parentComponent:C,container:M,namespace:H}=S;Ui(w,"onFallback");const P=b(T),R=()=>{S.isFallbackMountPending=!1,S.isInFallback&&(u(null,g,M,P,C,null,H,r,o),$a(S,g))},V=g.transition&&g.transition.mode==="out-in";V&&(S.isFallbackMountPending=!0,T.transition.afterLeave=R),S.isInFallback=!0,f(T,C,null,!0),V||R()},move(g,w,T){S.activeBranch&&p(S.activeBranch,g,w,T),S.container=g},next(){return S.activeBranch&&b(S.activeBranch)},registerDep(g,w,T){const C=!!S.pendingBranch;C&&S.deps++;const M=g.vnode.el;g.asyncDep.catch(H=>{pa(H,g,0)}).then(H=>{if(g.isUnmounted||S.isUnmounted||S.pendingId!==g.suspenseId)return;zi(),g.asyncResolved=!0;const{vnode:P}=g;Co(g,H,!1),M&&(P.el=M);const R=!M&&g.subTree.el;w(g,P,y(M||g.subTree.el),M?null:b(g.subTree),S,l,T),R&&(P.placeholder=null,E(R)),Cr(g,P.el),C&&--S.deps===0&&S.resolve()})},unmount(g,w){S.isUnmounted=!0,S.activeBranch&&f(S.activeBranch,s,g,w),S.pendingBranch&&f(S.pendingBranch,s,g,w)}};return S}function Pb(e,t,s,n,a,i,l,r,o){const c=t.suspense=Cf(t,n,s,e.parentNode,document.createElement("div"),null,a,i,l,r,!0),d=o(e,c.pendingBranch=t.ssContent,s,c,i,l);return c.deps===0&&c.resolve(!1,!0),d}function Fb(e){const{shapeFlag:t,children:s}=e,n=t&32;e.ssContent=Td(n?s.default:s),e.ssFallback=n?Td(s.fallback):pt(yt)}function Td(e){let t;if(Ie(e)){const s=ia&&e._c;s&&(e._d=!1,Bi()),e=e(),s&&(e._d=!0,t=Wt,Af())}return ye(e)&&(e=_b(e)),e=ps(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(s=>s!==e)),e}function Ef(e,t){t&&t.pendingBranch?ye(e)?t.effects.push(...e):t.effects.push(e):Mi(e)}function $a(e,t){e.activeBranch=t;const{vnode:s,parentComponent:n}=e;let a=t.el;for(;!a&&t.component;)t=t.component.subTree,a=t.el;s.el=a,n&&n.subTree===s&&(n.vnode.el=a,Cr(n,a))}function $b(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Dt=Symbol.for("v-fgt"),$n=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),sa=Symbol.for("v-stc"),Ti=[];let Wt=null;function Bi(e=!1){Ti.push(Wt=e?null:[])}function Af(){Ti.pop(),Wt=Ti[Ti.length-1]||null}let ia=1;function Hi(e,t=!1){ia+=e,e<0&&Wt&&t&&(Wt.hasOnce=!0)}function Rf(e){return e.dynamicChildren=ia>0?Wt||Na:null,Af(),ia>0&&Wt&&Wt.push(e),e}function Ub(e,t,s,n,a,i){return Rf(bc(e,t,s,n,a,i,!0))}function Vl(e,t,s,n,a){return Rf(pt(e,t,s,n,a,!0))}function Cn(e){return e?e.__v_isVNode===!0:!1}function Hs(e,t){return e.type===t.type&&e.key===t.key}function Bb(e){}const If=({key:e})=>e??null,El=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Me(e)||St(e)||Ie(e)?{i:Bt,r:e,k:t,f:!!s}:e:null);function bc(e,t=null,s=null,n=0,a=null,i=e===Dt?0:1,l=!1,r=!1){const o={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&If(t),ref:t&&El(t),scopeId:xr,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:n,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:Bt};return r?(xc(o,s),i&128&&e.normalize(o)):s&&(o.shapeFlag|=Me(s)?8:16),ia>0&&!l&&Wt&&(o.patchFlag>0||i&6)&&o.patchFlag!==32&&Wt.push(o),o}const pt=Hb;function Hb(e,t=null,s=null,n=0,a=null,i=!1){if((!e||e===af)&&(e=yt),Cn(e)){const r=sn(e,t,!0);return s&&xc(r,s),ia>0&&!i&&Wt&&(r.shapeFlag&6?Wt[Wt.indexOf(e)]=r:Wt.push(r)),r.patchFlag=-2,r}if(Wb(e)&&(e=e.__vccOpts),t){t=Of(t);let{class:r,style:o}=t;r&&!Me(r)&&(t.class=Yi(r)),Xe(o)&&(Qi(o)&&!ye(o)&&(o=ze({},o)),t.style=Ji(o))}const l=Me(e)?1:zl(e)?128:Kp(e)?64:Xe(e)?4:Ie(e)?2:0;return bc(e,t,s,n,a,l,i,!0)}function Of(e){return e?Qi(e)||hf(e)?ze({},e):e:null}function sn(e,t,s=!1,n=!1){const{props:a,ref:i,patchFlag:l,children:r,transition:o}=e,c=t?Lf(a||{},t):a,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&If(c),ref:t&&t.ref?s&&i?ye(i)?i.concat(El(t)):[i,El(t)]:El(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Dt?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:o,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&sn(e.ssContent),ssFallback:e.ssFallback&&sn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return o&&n&&Tn(d,o.clone(d)),d}function yc(e=" ",t=0){return pt($n,null,e,t)}function zb(e,t){const s=pt(sa,null,e);return s.staticCount=t,s}function Nf(e="",t=!1){return t?(Bi(),Vl(yt,null,e)):pt(yt,null,e)}function ps(e){return e==null||typeof e=="boolean"?pt(yt):ye(e)?pt(Dt,null,e.slice()):Cn(e)?un(e):pt($n,null,String(e))}function un(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sn(e)}function xc(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(ye(t))s=16;else if(typeof t=="object")if(n&65){const a=t.default;a&&(a._c&&(a._d=!1),xc(e,a()),a._c&&(a._d=!0));return}else{s=32;const a=t._;!a&&!hf(t)?t._ctx=Bt:a===3&&Bt&&(Bt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ie(t)?(t={default:t,_ctx:Bt},s=32):(t=String(t),n&64?(s=16,t=[yc(t)]):s=8);e.children=t,e.shapeFlag|=s}function Lf(...e){const t={};for(let s=0;sUt||Bt;let jl,Ua;{const e=hr(),t=(s,n)=>{let a;return(a=e[s])||(a=e[s]=[]),a.push(n),i=>{a.length>1?a.forEach(l=>l(i)):a[0](i)}};jl=t("__VUE_INSTANCE_SETTERS__",s=>Ut=s),Ua=t("__VUE_SSR_SETTERS__",s=>la=s)}const si=e=>{const t=Ut;return jl(e),e.scope.on(),()=>{e.scope.off(),jl(t)}},zi=()=>{Ut&&Ut.scope.off(),jl(null)};function Mf(e){return e.vnode.shapeFlag&4}let la=!1;function Pf(e,t=!1,s=!1){t&&Ua(t);const{props:n,children:a}=e.vnode,i=Mf(e);Tb(e,n,i,t),Rb(e,a,s||t);const l=i?qb(e,t):void 0;return t&&Ua(!1),l}function qb(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,_o);const{setup:n}=s;if(n){wn();const a=e.setupContext=n.length>1?Uf(e):null,i=si(e),l=ti(n,e,0,[e.props,a]),r=Yo(l);if(Sn(),i(),(r||e.sp)&&!xn(e)&&cc(e),r){if(l.then(zi,zi),t)return l.then(o=>{Co(e,o,t)}).catch(o=>{pa(o,e,0)});e.asyncDep=l}else Co(e,l,t)}else $f(e,t)}function Co(e,t,s){Ie(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Xe(t)&&(e.setupState=ac(t)),$f(e,s)}let ql,Eo;function Ff(e){ql=e,Eo=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,Yv))}}const Gb=()=>!ql;function $f(e,t,s){const n=e.type;if(!e.render){if(!t&&ql&&!n.render){const a=n.template||hc(e).template;if(a){const{isCustomElement:i,compilerOptions:l}=e.appContext.config,{delimiters:r,compilerOptions:o}=n,c=ze(ze({isCustomElement:i,delimiters:r},l),o);n.render=ql(a,c)}}e.render=n.render||Ht,Eo&&Eo(e)}{const a=si(e);wn();try{ub(e)}finally{Sn(),a()}}}const Kb={get(e,t){return Kt(e,"get",""),e[t]}};function Uf(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Kb),slots:e.slots,emit:e.emit,expose:t}}function sl(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ac(Np(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Si)return Si[s](e)},has(t,s){return s in t||s in Si}})):e.proxy}function Ao(e,t=!0){return Ie(e)?e.displayName||e.name:e.name||t&&e.__name}function Wb(e){return Ie(e)&&"__vccOpts"in e}const J=(e,t)=>ev(e,t,la);function ja(e,t,s){try{Hi(-1);const n=arguments.length;return n===2?Xe(t)&&!ye(t)?Cn(t)?pt(e,null,[t]):pt(e,t):pt(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&Cn(s)&&(s=[s]),pt(e,t,s))}finally{Hi(1)}}function Zb(){}function Jb(e,t,s,n){const a=s[n];if(a&&Bf(a,e))return a;const i=t();return i.memo=e.slice(),i.cacheIndex=n,s[n]=i}function Bf(e,t){const s=e.memo;if(s.length!=t.length)return!1;for(let n=0;n0&&Wt&&Wt.push(e),!0}const Hf="3.5.38",Yb=Ht,Qb=cv,Xb=Ea,ey=Hp,ty={createComponentInstance:Df,setupComponent:Pf,renderComponentRoot:Cl,setCurrentRenderingInstance:Fi,isVNode:Cn,normalizeVNode:ps,getComponentPublicInstance:sl,ensureValidVNode:fc,pushWarningContext:iv,popWarningContext:lv},sy=ty,ny=null,ay=null,iy=null;/** * @vue/runtime-dom v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let Ro;const Cd=typeof window<"u"&&window.trustedTypes;if(Cd)try{Ro=Cd.createPolicy("vue",{createHTML:e=>e})}catch{}const zp=Ro?e=>Ro.createHTML(e):e=>e,ly="http://www.w3.org/2000/svg",ry="http://www.w3.org/1998/Math/MathML",dn=typeof document<"u"?document:null,Ed=dn&&dn.createElement("template"),Vp={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const a=t==="svg"?dn.createElementNS(ly,e):t==="mathml"?dn.createElementNS(ry,e):s?dn.createElement(e,{is:s}):dn.createElement(e);return e==="select"&&n&&n.multiple!=null&&a.setAttribute("multiple",n.multiple),a},createText:e=>dn.createTextNode(e),createComment:e=>dn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,a,i){const l=s?s.previousSibling:t.lastChild;if(a&&(a===i||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),s),!(a===i||!(a=a.nextSibling)););else{Ed.innerHTML=zp(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const r=Ed.content;if(n==="svg"||n==="mathml"){const o=r.firstChild;for(;o.firstChild;)r.appendChild(o.firstChild);r.removeChild(o)}t.insertBefore(r,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Rn="transition",ci="animation",qa=Symbol("_vtc"),jp={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},qp=ze({},oc,jp),oy=e=>(e.displayName="Transition",e.props=qp,e),cy=oy((e,{slots:t})=>ja(Yf,Gp(e),t)),Gn=(e,t=[])=>{be(e)?e.forEach(s=>s(...t)):e&&e(...t)},Ad=e=>e?be(e)?e.some(t=>t.length>1):e.length>1:!1;function Gp(e){const t={};for(const P in e)P in jp||(t[P]=e[P]);if(e.css===!1)return t;const{name:s="v",type:n,duration:a,enterFromClass:i=`${s}-enter-from`,enterActiveClass:l=`${s}-enter-active`,enterToClass:r=`${s}-enter-to`,appearFromClass:o=i,appearActiveClass:c=l,appearToClass:d=r,leaveFromClass:u=`${s}-leave-from`,leaveActiveClass:f=`${s}-leave-active`,leaveToClass:p=`${s}-leave-to`}=e,b=dy(a),y=b&&b[0],E=b&&b[1],{onBeforeEnter:I,onEnter:x,onEnterCancelled:m,onLeave:_,onLeaveCancelled:S,onBeforeAppear:g=I,onAppear:w=x,onAppearCancelled:T=m}=t,C=(P,R,j,Q)=>{P._enterCancelled=Q,Ln(P,R?d:r),Ln(P,R?c:l),j&&j()},M=(P,R)=>{P._isLeaving=!1,Ln(P,u),Ln(P,p),Ln(P,f),R&&R()},H=P=>(R,j)=>{const Q=P?w:x,U=()=>C(R,P,j);Gn(Q,[R,U]),Rd(()=>{Ln(R,P?o:i),Ws(R,P?d:r),Ad(Q)||Id(R,n,y,U)})};return ze(t,{onBeforeEnter(P){Gn(I,[P]),Ws(P,i),Ws(P,l)},onBeforeAppear(P){Gn(g,[P]),Ws(P,o),Ws(P,c)},onEnter:H(!1),onAppear:H(!0),onLeave(P,R){P._isLeaving=!0;const j=()=>M(P,R);Ws(P,u),P._enterCancelled?(Ws(P,f),Io(P)):(Io(P),Ws(P,f)),Rd(()=>{P._isLeaving&&(Ln(P,u),Ws(P,p),Ad(_)||Id(P,n,E,j))}),Gn(_,[P,j])},onEnterCancelled(P){C(P,!1,void 0,!0),Gn(m,[P])},onAppearCancelled(P){C(P,!0,void 0,!0),Gn(T,[P])},onLeaveCancelled(P){M(P),Gn(S,[P])}})}function dy(e){if(e==null)return null;if(Xe(e))return[Wr(e.enter),Wr(e.leave)];{const t=Wr(e);return[t,t]}}function Wr(e){return Ll(e)}function Ws(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.add(s)),(e[qa]||(e[qa]=new Set)).add(t)}function Ln(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const s=e[qa];s&&(s.delete(t),s.size||(e[qa]=void 0))}function Rd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let uy=0;function Id(e,t,s,n){const a=e._endId=++uy,i=()=>{a===e._endId&&n()};if(s!=null)return setTimeout(i,s);const{type:l,timeout:r,propCount:o}=Kp(e,t);if(!l)return n();const c=l+"end";let d=0;const u=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++d>=o&&u()};setTimeout(()=>{d(s[b]||"").split(", "),a=n(`${Rn}Delay`),i=n(`${Rn}Duration`),l=Od(a,i),r=n(`${ci}Delay`),o=n(`${ci}Duration`),c=Od(r,o);let d=null,u=0,f=0;t===Rn?l>0&&(d=Rn,u=l,f=i.length):t===ci?c>0&&(d=ci,u=c,f=o.length):(u=Math.max(l,c),d=u>0?l>c?Rn:ci:null,f=d?d===Rn?i.length:o.length:0);const p=d===Rn&&/\b(?:transform|all)(?:,|$)/.test(n(`${Rn}Property`).toString());return{type:d,timeout:u,propCount:f,hasTransform:p}}function Od(e,t){for(;e.lengthNd(s)+Nd(e[n])))}function Nd(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Io(e){return(e?e.ownerDocument:document).body.offsetHeight}function fy(e,t,s){const n=e[qa];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Gl=Symbol("_vod"),_c=Symbol("_vsh"),Wp={name:"show",beforeMount(e,{value:t},{transition:s}){e[Gl]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):di(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),di(e,!0),n.enter(e)):n.leave(e,()=>{di(e,!1)}):di(e,t))},beforeUnmount(e,{value:t}){di(e,t)}};function di(e,t){e.style.display=t?e[Gl]:"none",e[_c]=!t}function py(){Wp.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Zp=Symbol("");function hy(e){const t=as();if(!t)return;const s=t.ut=(a=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Kl(i,a))},n=()=>{const a=e(t.proxy);t.ce?Kl(t.ce,a):Oo(t.subTree,a),s(a)};dc(()=>{Mi(n)}),We(()=>{ns(n,Ht,{flush:"post"});const a=new MutationObserver(n);a.observe(t.subTree.el.parentNode,{childList:!0}),xt(()=>a.disconnect())})}function Oo(e,t){if(e.shapeFlag&128){const s=e.suspense;e=s.activeBranch,s.pendingBranch&&!s.isHydrating&&s.effects.push(()=>{Oo(s.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Kl(e.el,t);else if(e.type===Dt)e.children.forEach(s=>Oo(s,t));else if(e.type===sa){let{el:s,anchor:n}=e;for(;s&&(Kl(s,t),s!==n);)s=s.nextSibling}}function Kl(e,t){if(e.nodeType===1){const s=e.style;let n="";for(const a in t){const i=xg(t[a]);s.setProperty(`--${a}`,i),n+=`--${a}: ${i};`}s[Zp]=n}}const my=/(?:^|;)\s*display\s*:/;function gy(e,t,s){const n=e.style,a=Me(s);let i=!1;if(s&&!a){if(t)if(Me(t))for(const l of t.split(";")){const r=l.slice(0,l.indexOf(":")).trim();s[r]==null&&yi(n,r,"")}else for(const l in t)s[l]==null&&yi(n,l,"");for(const l in s){l==="display"&&(i=!0);const r=s[l];r!=null?by(e,l,!Me(t)&&t?t[l]:void 0,r)||yi(n,l,r):yi(n,l,"")}}else if(a){if(t!==s){const l=n[Zp];l&&(s+=";"+l),n.cssText=s,i=my.test(s)}}else t&&e.removeAttribute("style");Gl in e&&(e[Gl]=i?n.display:"",e[_c]&&(n.display="none"))}const Ld=/\s*!important$/;function yi(e,t,s){if(be(s))s.forEach(n=>yi(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=vy(e,t);Ld.test(s)?e.setProperty(ps(n),s.replace(Ld,""),"important"):e[n]=s}}const Dd=["Webkit","Moz","ms"],Zr={};function vy(e,t){const s=Zr[t];if(s)return s;let n=it(t);if(n!=="filter"&&n in e)return Zr[t]=n;n=ua(n);for(let a=0;aJr||(ky.then(()=>Jr=0),Jr=Date.now());function Sy(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const a=s.value;if(be(a)){const i=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{i.call(n),n._stopped=!0};const l=a.slice(),r=[n];for(let o=0;oe.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Jp=(e,t,s,n,a,i)=>{const l=a==="svg";t==="class"?fy(e,n,l):t==="style"?gy(e,s,n):ca(t)?cr(t)||xy(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ty(e,t,n,l))?(Fd(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Pd(e,t,n,l,i,t!=="value")):e._isVueCE&&(Cy(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Me(n)))?Fd(e,it(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Pd(e,t,n,l))};function Ty(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ud(t)&&Ie(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return Ud(t)&&Me(s)?!1:t in e}function Cy(e,t){const s=e._def.props;if(!s)return!1;const n=it(t);return Array.isArray(s)?s.some(a=>it(a)===n):Object.keys(s).some(a=>it(a)===n)}const Hd={};function Yp(e,t,s){let n=el(e,t);dr(n)&&(n=ze({},n,t));class a extends Er{constructor(l){super(n,l,s)}}return a.def=n,a}const Ey=((e,t)=>Yp(e,t,dh)),Ay=typeof HTMLElement<"u"?HTMLElement:class{};class Er extends Ay{constructor(t,s={},n=Jl){super(),this._def=t,this._props=s,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==Jl?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(ze({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof Er){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Rt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const s of t)this._setAttr(s.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:l}=n;let r;if(i&&!be(i))for(const o in i){const c=i[o];(c===Number||c&&c.type===Number)&&(o in this._props&&(this._props[o]=Ll(this._props[o])),(r||(r=Object.create(null)))[it(o)]=!0)}this._numberProps=r,this._resolveProps(n),this.shadowRoot&&this._applyStyles(l),this._mount(n)},s=this._def.__asyncLoader;s?this._pendingResolve=s().then(n=>{n.configureApp=this._def.configureApp,t(this._def=n,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const s=this._instance&&this._instance.exposed;if(s)for(const n in s)tt(this,n)||Object.defineProperty(this,n,{get:()=>en(s[n])})}_resolveProps(t){const{props:s}=t,n=be(s)?s:Object.keys(s||{});for(const a of Object.keys(this))a[0]!=="_"&&n.includes(a)&&this._setProp(a,this[a]);for(const a of n.map(it))Object.defineProperty(this,a,{get(){return this._getProp(a)},set(i){this._setProp(a,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const s=this.hasAttribute(t);let n=s?this.getAttribute(t):Hd;const a=it(t);s&&this._numberProps&&this._numberProps[a]&&(n=Ll(n)),this._setProp(a,n,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,s,n=!0,a=!1){if(s!==this._props[t]&&(this._dirty=!0,s===Hd?delete this._props[t]:(this._props[t]=s,t==="key"&&this._app&&(this._app._ceVNode.key=s)),a&&this._instance&&this._update(),n)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),s===!0?this.setAttribute(ps(t),""):typeof s=="string"||typeof s=="number"?this.setAttribute(ps(t),s+""):s||this.removeAttribute(ps(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),ch(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const s=ft(this._def,ze(t,this._props));return this._instance||(s.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0;const a=(i,l)=>{this.dispatchEvent(new CustomEvent(i,dr(l[0])?ze({detail:l},l[0]):{detail:l}))};n.emit=(i,...l)=>{a(i,l),ps(i)!==i&&a(ps(i),l)},this._setParent()}),s}_applyStyles(t,s,n){if(!t)return;if(s){if(s===this._def||this._styleChildren.has(s))return;this._styleChildren.add(s)}const a=this._nonce,i=this.shadowRoot,l=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let r=null;for(let o=t.length-1;o>=0;o--){const c=document.createElement("style");a&&c.setAttribute("nonce",a),c.textContent=t[o],i.insertBefore(c,r||l),r=c,o===0&&(n||this._styleAnchors.set(this._def,c),s&&this._styleAnchors.set(s,c))}}_getStyleAnchor(t){if(!t)return null;const s=this._styleAnchors.get(t);return s&&s.parentNode===this.shadowRoot?s:(s&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let s=0;s(delete e.props.mode,e),Ny=Oy({name:"TransitionGroup",props:ze({},qp,{tag:String,moveClass:String}),setup(e,{slots:t}){const s=as(),n=rc();let a,i;return wr(()=>{if(!a.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!Fy(a[0].el,s.vnode.el,l)){a=[];return}a.forEach(Dy),a.forEach(My);const r=a.filter(Py);Io(s.vnode.el),r.forEach(o=>{const c=o.el,d=c.style;Ws(c,l),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[Wl]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",u),c[Wl]=null,Ln(c,l))};c.addEventListener("transitionend",u)}),a=[]}),()=>{const l=Je(e),r=Gp(l);let o=l.tag||Dt;if(a=[],i)for(let c=0;c{r.split(/\s+/).forEach(o=>o&&n.classList.remove(o))}),s.split(/\s+/).forEach(r=>r&&n.classList.add(r)),n.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(n);const{hasTransform:l}=Kp(n);return i.removeChild(n),l}const Un=e=>{const t=e.props["onUpdate:modelValue"]||!1;return be(t)?s=>Ma(t,s):t};function $y(e){e.target.composing=!0}function Vd(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ns=Symbol("_assign");function jd(e,t,s){return t&&(e=e.trim()),s&&(e=pr(e)),e}const Zl={created(e,{modifiers:{lazy:t,trim:s,number:n}},a){e[Ns]=Un(a);const i=n||a.props&&a.props.type==="number";mn(e,t?"change":"input",l=>{l.target.composing||e[Ns](jd(e.value,s,i))}),(s||i)&&mn(e,"change",()=>{e.value=jd(e.value,s,i)}),t||(mn(e,"compositionstart",$y),mn(e,"compositionend",Vd),mn(e,"change",Vd))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:a,number:i}},l){if(e[Ns]=Un(l),e.composing)return;const r=(i||e.type==="number")&&!/^0\d/.test(e.value)?pr(e.value):e.value,o=t??"";if(r===o)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(n&&t===s||a&&e.value.trim()===o)||(e.value=o)}},kc={deep:!0,created(e,t,s){e[Ns]=Un(s),mn(e,"change",()=>{const n=e._modelValue,a=Ga(e),i=e.checked,l=e[Ns];if(be(n)){const r=mr(n,a),o=r!==-1;if(i&&!o)l(n.concat(a));else if(!i&&o){const c=[...n];c.splice(r,1),l(c)}}else if(da(n)){const r=new Set(n);i?r.add(a):r.delete(a),l(r)}else l(nh(e,i))})},mounted:qd,beforeUpdate(e,t,s){e[Ns]=Un(s),qd(e,t,s)}};function qd(e,{value:t,oldValue:s},n){e._modelValue=t;let a;if(be(t))a=mr(t,n.props.value)>-1;else if(da(t))a=t.has(n.props.value);else{if(t===s)return;a=kn(t,nh(e,!0))}e.checked!==a&&(e.checked=a)}const wc={created(e,{value:t},s){e.checked=kn(t,s.props.value),e[Ns]=Un(s),mn(e,"change",()=>{e[Ns](Ga(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[Ns]=Un(n),t!==s&&(e.checked=kn(t,n.props.value))}},sh={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const a=da(t);mn(e,"change",()=>{const i=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?pr(Ga(l)):Ga(l));e[Ns](e.multiple?a?new Set(i):i:i[0]),e._assigning=!0,Rt(()=>{e._assigning=!1})}),e[Ns]=Un(n)},mounted(e,{value:t}){Gd(e,t)},beforeUpdate(e,t,s){e[Ns]=Un(s)},updated(e,{value:t}){e._assigning||Gd(e,t)}};function Gd(e,t){const s=e.multiple,n=be(t);if(!(s&&!n&&!da(t))){for(let a=0,i=e.options.length;aString(c)===String(r)):l.selected=mr(t,r)>-1}else l.selected=t.has(r);else if(kn(Ga(l),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ga(e){return"_value"in e?e._value:e.value}function nh(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const ah={created(e,t,s){bl(e,t,s,null,"created")},mounted(e,t,s){bl(e,t,s,null,"mounted")},beforeUpdate(e,t,s,n){bl(e,t,s,n,"beforeUpdate")},updated(e,t,s,n){bl(e,t,s,n,"updated")}};function ih(e,t){switch(e){case"SELECT":return sh;case"TEXTAREA":return Zl;default:switch(t){case"checkbox":return kc;case"radio":return wc;default:return Zl}}}function bl(e,t,s,n,a){const l=ih(e.tagName,s.props&&s.props.type)[a];l&&l(e,t,s,n)}function By(){Zl.getSSRProps=({value:e})=>({value:e}),wc.getSSRProps=({value:e},t)=>{if(t.props&&kn(t.props.value,e))return{checked:!0}},kc.getSSRProps=({value:e},t)=>{if(be(e)){if(t.props&&mr(e,t.props.value)>-1)return{checked:!0}}else if(da(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},ah.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const s=ih(t.type.toUpperCase(),t.props&&t.props.type);if(s.getSSRProps)return s.getSSRProps(e,t)}}const Uy=["ctrl","shift","alt","meta"],Hy={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Uy.some(s=>e[`${s}Key`]&&!t.includes(s))},zy=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((a,...i)=>{for(let l=0;l{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(a=>{if(!("key"in a))return;const i=ps(a.key);if(t.some(l=>l===i||Vy[l]===i))return e(a)}))},lh=ze({patchProp:Jp},Vp);let Ci,Kd=!1;function rh(){return Ci||(Ci=xp(lh))}function oh(){return Ci=Kd?Ci:_p(lh),Kd=!0,Ci}const ch=((...e)=>{rh().render(...e)}),qy=((...e)=>{oh().hydrate(...e)}),Jl=((...e)=>{const t=rh().createApp(...e),{mount:s}=t;return t.mount=n=>{const a=fh(n);if(!a)return;const i=t._component;!Ie(i)&&!i.render&&!i.template&&(i.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const l=s(a,!1,uh(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),l},t}),dh=((...e)=>{const t=oh().createApp(...e),{mount:s}=t;return t.mount=n=>{const a=fh(n);if(a)return s(a,!0,uh(a))},t});function uh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function fh(e){return Me(e)?document.querySelector(e):e}let Wd=!1;const Gy=()=>{Wd||(Wd=!0,By(),py())},Ky=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:Yf,BaseTransitionPropsValidators:oc,Comment:yt,DeprecationTypes:iy,EffectScope:Qo,ErrorCodes:ov,ErrorTypeStrings:Qb,Fragment:Dt,KeepAlive:Hv,ReactiveEffect:Ni,Static:sa,Suspense:Lb,Teleport:wv,Text:$n,TrackOpTypes:tv,Transition:cy,TransitionGroup:Ly,TriggerOpTypes:sv,VueElement:Er,assertNumber:rv,callWithAsyncErrorHandling:xs,callWithErrorHandling:ti,camelize:it,capitalize:ua,cloneVNode:sn,compatUtils:ay,computed:J,createApp:Jl,createBlock:Vl,createCommentVNode:Np,createElementBlock:Bb,createElementVNode:bc,createHydrationRenderer:_p,createPropsRestProxy:cb,createRenderer:xp,createSSRApp:dh,createSlots:Wv,createStaticVNode:zb,createTextVNode:yc,createVNode:ft,customRef:Mf,defineAsyncComponent:Bv,defineComponent:el,defineCustomElement:Yp,defineEmits:Xv,defineExpose:eb,defineModel:nb,defineOptions:tb,defineProps:Qv,defineSSRCustomElement:Ey,defineSlots:sb,devtools:Xb,effect:Sg,effectScope:_g,getCurrentInstance:as,getCurrentScope:vf,getCurrentWatcher:nv,getTransitionRawChildren:_r,guardReactiveProps:Op,h:ja,handleError:fa,hasInjectionContext:gv,hydrate:qy,hydrateOnIdle:Lv,hydrateOnInteraction:Fv,hydrateOnMediaQuery:Pv,hydrateOnVisible:Mv,initCustomFormatter:Zb,initDirectivesForSSR:Gy,inject:Os,isMemoSame:Up,isProxy:Qi,isReactive:yn,isReadonly:tn,isRef:St,isRuntimeOnly:Gb,isShallow:ms,isVNode:Cn,markRaw:Lf,mergeDefaults:rb,mergeModels:ob,mergeProps:Lp,nextTick:Rt,nodeOps:Vp,normalizeClass:Yi,normalizeProps:og,normalizeStyle:Ji,onActivated:Ds,onBeforeMount:ep,onBeforeUnmount:Sr,onBeforeUpdate:dc,onDeactivated:Ms,onErrorCaptured:ap,onMounted:We,onRenderTracked:np,onRenderTriggered:sp,onScopeDispose:kg,onServerPrefetch:tp,onUnmounted:xt,onUpdated:wr,onWatcherCleanup:Ff,openBlock:Ui,patchProp:Jp,popScopeId:pv,provide:wi,proxyRefs:ac,pushScopeId:fv,queuePostFlushCb:Mi,reactive:Hn,readonly:Ml,ref:h,registerRuntimeCompiler:Fp,render:ch,renderList:Kv,renderSlot:Zv,resolveComponent:jv,resolveDirective:Gv,resolveDynamicComponent:qv,resolveFilter:ny,resolveTransitionHooks:Va,setBlockTracking:Hi,setDevtoolsHook:ey,setTransitionHooks:Tn,shallowReactive:sc,shallowReadonly:Vg,shallowRef:nc,ssrContextKey:Vf,ssrUtils:sy,stop:Tg,toDisplayString:mf,toHandlerKey:Da,toHandlers:Jv,toRaw:Je,toRef:Qg,toRefs:Zg,toValue:Gg,transformVNodeArgs:Ub,triggerRef:qg,unref:en,useAttrs:lb,useCssModule:Iy,useCssVars:hy,useHost:Qp,useId:Tv,useModel:bb,useSSRContext:jf,useShadowRoot:Ry,useSlots:ib,useTemplateRef:Cv,useTransitionState:rc,vModelCheckbox:kc,vModelDynamic:ah,vModelRadio:wc,vModelSelect:sh,vModelText:Zl,vShow:Wp,version:Hp,warn:Yb,watch:ns,watchEffect:vv,watchPostEffect:bv,watchSyncEffect:qf,withAsyncContext:db,withCtx:lc,withDefaults:ab,withDirectives:mv,withKeys:jy,withMemo:Jb,withModifiers:zy,withScopeId:hv},Symbol.toStringTag,{value:"Module"}));/** +**/let Ro;const Cd=typeof window<"u"&&window.trustedTypes;if(Cd)try{Ro=Cd.createPolicy("vue",{createHTML:e=>e})}catch{}const zf=Ro?e=>Ro.createHTML(e):e=>e,ly="http://www.w3.org/2000/svg",ry="http://www.w3.org/1998/Math/MathML",dn=typeof document<"u"?document:null,Ed=dn&&dn.createElement("template"),Vf={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const a=t==="svg"?dn.createElementNS(ly,e):t==="mathml"?dn.createElementNS(ry,e):s?dn.createElement(e,{is:s}):dn.createElement(e);return e==="select"&&n&&n.multiple!=null&&a.setAttribute("multiple",n.multiple),a},createText:e=>dn.createTextNode(e),createComment:e=>dn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,a,i){const l=s?s.previousSibling:t.lastChild;if(a&&(a===i||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),s),!(a===i||!(a=a.nextSibling)););else{Ed.innerHTML=zf(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const r=Ed.content;if(n==="svg"||n==="mathml"){const o=r.firstChild;for(;o.firstChild;)r.appendChild(o.firstChild);r.removeChild(o)}t.insertBefore(r,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Rn="transition",ci="animation",qa=Symbol("_vtc"),jf={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},qf=ze({},oc,jf),oy=e=>(e.displayName="Transition",e.props=qf,e),cy=oy((e,{slots:t})=>ja(Jp,Gf(e),t)),Gn=(e,t=[])=>{ye(e)?e.forEach(s=>s(...t)):e&&e(...t)},Ad=e=>e?ye(e)?e.some(t=>t.length>1):e.length>1:!1;function Gf(e){const t={};for(const P in e)P in jf||(t[P]=e[P]);if(e.css===!1)return t;const{name:s="v",type:n,duration:a,enterFromClass:i=`${s}-enter-from`,enterActiveClass:l=`${s}-enter-active`,enterToClass:r=`${s}-enter-to`,appearFromClass:o=i,appearActiveClass:c=l,appearToClass:d=r,leaveFromClass:u=`${s}-leave-from`,leaveActiveClass:p=`${s}-leave-active`,leaveToClass:f=`${s}-leave-to`}=e,b=dy(a),y=b&&b[0],E=b&&b[1],{onBeforeEnter:O,onEnter:x,onEnterCancelled:m,onLeave:_,onLeaveCancelled:S,onBeforeAppear:g=O,onAppear:w=x,onAppearCancelled:T=m}=t,C=(P,R,V,Q)=>{P._enterCancelled=Q,Ln(P,R?d:r),Ln(P,R?c:l),V&&V()},M=(P,R)=>{P._isLeaving=!1,Ln(P,u),Ln(P,f),Ln(P,p),R&&R()},H=P=>(R,V)=>{const Q=P?w:x,U=()=>C(R,P,V);Gn(Q,[R,U]),Rd(()=>{Ln(R,P?o:i),Ws(R,P?d:r),Ad(Q)||Id(R,n,y,U)})};return ze(t,{onBeforeEnter(P){Gn(O,[P]),Ws(P,i),Ws(P,l)},onBeforeAppear(P){Gn(g,[P]),Ws(P,o),Ws(P,c)},onEnter:H(!1),onAppear:H(!0),onLeave(P,R){P._isLeaving=!0;const V=()=>M(P,R);Ws(P,u),P._enterCancelled?(Ws(P,p),Io(P)):(Io(P),Ws(P,p)),Rd(()=>{P._isLeaving&&(Ln(P,u),Ws(P,f),Ad(_)||Id(P,n,E,V))}),Gn(_,[P,V])},onEnterCancelled(P){C(P,!1,void 0,!0),Gn(m,[P])},onAppearCancelled(P){C(P,!0,void 0,!0),Gn(T,[P])},onLeaveCancelled(P){M(P),Gn(S,[P])}})}function dy(e){if(e==null)return null;if(Xe(e))return[Wr(e.enter),Wr(e.leave)];{const t=Wr(e);return[t,t]}}function Wr(e){return Ll(e)}function Ws(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.add(s)),(e[qa]||(e[qa]=new Set)).add(t)}function Ln(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const s=e[qa];s&&(s.delete(t),s.size||(e[qa]=void 0))}function Rd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let uy=0;function Id(e,t,s,n){const a=e._endId=++uy,i=()=>{a===e._endId&&n()};if(s!=null)return setTimeout(i,s);const{type:l,timeout:r,propCount:o}=Kf(e,t);if(!l)return n();const c=l+"end";let d=0;const u=()=>{e.removeEventListener(c,p),i()},p=f=>{f.target===e&&++d>=o&&u()};setTimeout(()=>{d(s[b]||"").split(", "),a=n(`${Rn}Delay`),i=n(`${Rn}Duration`),l=Od(a,i),r=n(`${ci}Delay`),o=n(`${ci}Duration`),c=Od(r,o);let d=null,u=0,p=0;t===Rn?l>0&&(d=Rn,u=l,p=i.length):t===ci?c>0&&(d=ci,u=c,p=o.length):(u=Math.max(l,c),d=u>0?l>c?Rn:ci:null,p=d?d===Rn?i.length:o.length:0);const f=d===Rn&&/\b(?:transform|all)(?:,|$)/.test(n(`${Rn}Property`).toString());return{type:d,timeout:u,propCount:p,hasTransform:f}}function Od(e,t){for(;e.lengthNd(s)+Nd(e[n])))}function Nd(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Io(e){return(e?e.ownerDocument:document).body.offsetHeight}function py(e,t,s){const n=e[qa];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Gl=Symbol("_vod"),_c=Symbol("_vsh"),Wf={name:"show",beforeMount(e,{value:t},{transition:s}){e[Gl]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):di(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),di(e,!0),n.enter(e)):n.leave(e,()=>{di(e,!1)}):di(e,t))},beforeUnmount(e,{value:t}){di(e,t)}};function di(e,t){e.style.display=t?e[Gl]:"none",e[_c]=!t}function fy(){Wf.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Zf=Symbol("");function hy(e){const t=as();if(!t)return;const s=t.ut=(a=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>Kl(i,a))},n=()=>{const a=e(t.proxy);t.ce?Kl(t.ce,a):Oo(t.subTree,a),s(a)};dc(()=>{Mi(n)}),We(()=>{ns(n,Ht,{flush:"post"});const a=new MutationObserver(n);a.observe(t.subTree.el.parentNode,{childList:!0}),xt(()=>a.disconnect())})}function Oo(e,t){if(e.shapeFlag&128){const s=e.suspense;e=s.activeBranch,s.pendingBranch&&!s.isHydrating&&s.effects.push(()=>{Oo(s.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Kl(e.el,t);else if(e.type===Dt)e.children.forEach(s=>Oo(s,t));else if(e.type===sa){let{el:s,anchor:n}=e;for(;s&&(Kl(s,t),s!==n);)s=s.nextSibling}}function Kl(e,t){if(e.nodeType===1){const s=e.style;let n="";for(const a in t){const i=xg(t[a]);s.setProperty(`--${a}`,i),n+=`--${a}: ${i};`}s[Zf]=n}}const my=/(?:^|;)\s*display\s*:/;function gy(e,t,s){const n=e.style,a=Me(s);let i=!1;if(s&&!a){if(t)if(Me(t))for(const l of t.split(";")){const r=l.slice(0,l.indexOf(":")).trim();s[r]==null&&yi(n,r,"")}else for(const l in t)s[l]==null&&yi(n,l,"");for(const l in s){l==="display"&&(i=!0);const r=s[l];r!=null?by(e,l,!Me(t)&&t?t[l]:void 0,r)||yi(n,l,r):yi(n,l,"")}}else if(a){if(t!==s){const l=n[Zf];l&&(s+=";"+l),n.cssText=s,i=my.test(s)}}else t&&e.removeAttribute("style");Gl in e&&(e[Gl]=i?n.display:"",e[_c]&&(n.display="none"))}const Ld=/\s*!important$/;function yi(e,t,s){if(ye(s))s.forEach(n=>yi(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=vy(e,t);Ld.test(s)?e.setProperty(fs(n),s.replace(Ld,""),"important"):e[n]=s}}const Dd=["Webkit","Moz","ms"],Zr={};function vy(e,t){const s=Zr[t];if(s)return s;let n=it(t);if(n!=="filter"&&n in e)return Zr[t]=n;n=ua(n);for(let a=0;aJr||(ky.then(()=>Jr=0),Jr=Date.now());function Sy(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const a=s.value;if(ye(a)){const i=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{i.call(n),n._stopped=!0};const l=a.slice(),r=[n];for(let o=0;oe.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Jf=(e,t,s,n,a,i)=>{const l=a==="svg";t==="class"?py(e,n,l):t==="style"?gy(e,s,n):ca(t)?cr(t)||xy(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ty(e,t,n,l))?(Fd(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Pd(e,t,n,l,i,t!=="value")):e._isVueCE&&(Cy(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Me(n)))?Fd(e,it(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Pd(e,t,n,l))};function Ty(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Bd(t)&&Ie(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return Bd(t)&&Me(s)?!1:t in e}function Cy(e,t){const s=e._def.props;if(!s)return!1;const n=it(t);return Array.isArray(s)?s.some(a=>it(a)===n):Object.keys(s).some(a=>it(a)===n)}const Hd={};function Yf(e,t,s){let n=el(e,t);dr(n)&&(n=ze({},n,t));class a extends Er{constructor(l){super(n,l,s)}}return a.def=n,a}const Ey=((e,t)=>Yf(e,t,dh)),Ay=typeof HTMLElement<"u"?HTMLElement:class{};class Er extends Ay{constructor(t,s={},n=Jl){super(),this._def=t,this._props=s,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==Jl?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(ze({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof Er){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Rt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const s of t)this._setAttr(s.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:l}=n;let r;if(i&&!ye(i))for(const o in i){const c=i[o];(c===Number||c&&c.type===Number)&&(o in this._props&&(this._props[o]=Ll(this._props[o])),(r||(r=Object.create(null)))[it(o)]=!0)}this._numberProps=r,this._resolveProps(n),this.shadowRoot&&this._applyStyles(l),this._mount(n)},s=this._def.__asyncLoader;s?this._pendingResolve=s().then(n=>{n.configureApp=this._def.configureApp,t(this._def=n,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const s=this._instance&&this._instance.exposed;if(s)for(const n in s)tt(this,n)||Object.defineProperty(this,n,{get:()=>en(s[n])})}_resolveProps(t){const{props:s}=t,n=ye(s)?s:Object.keys(s||{});for(const a of Object.keys(this))a[0]!=="_"&&n.includes(a)&&this._setProp(a,this[a]);for(const a of n.map(it))Object.defineProperty(this,a,{get(){return this._getProp(a)},set(i){this._setProp(a,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const s=this.hasAttribute(t);let n=s?this.getAttribute(t):Hd;const a=it(t);s&&this._numberProps&&this._numberProps[a]&&(n=Ll(n)),this._setProp(a,n,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,s,n=!0,a=!1){if(s!==this._props[t]&&(this._dirty=!0,s===Hd?delete this._props[t]:(this._props[t]=s,t==="key"&&this._app&&(this._app._ceVNode.key=s)),a&&this._instance&&this._update(),n)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),s===!0?this.setAttribute(fs(t),""):typeof s=="string"||typeof s=="number"?this.setAttribute(fs(t),s+""):s||this.removeAttribute(fs(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),ch(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const s=pt(this._def,ze(t,this._props));return this._instance||(s.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0;const a=(i,l)=>{this.dispatchEvent(new CustomEvent(i,dr(l[0])?ze({detail:l},l[0]):{detail:l}))};n.emit=(i,...l)=>{a(i,l),fs(i)!==i&&a(fs(i),l)},this._setParent()}),s}_applyStyles(t,s,n){if(!t)return;if(s){if(s===this._def||this._styleChildren.has(s))return;this._styleChildren.add(s)}const a=this._nonce,i=this.shadowRoot,l=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let r=null;for(let o=t.length-1;o>=0;o--){const c=document.createElement("style");a&&c.setAttribute("nonce",a),c.textContent=t[o],i.insertBefore(c,r||l),r=c,o===0&&(n||this._styleAnchors.set(this._def,c),s&&this._styleAnchors.set(s,c))}}_getStyleAnchor(t){if(!t)return null;const s=this._styleAnchors.get(t);return s&&s.parentNode===this.shadowRoot?s:(s&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let s=0;s(delete e.props.mode,e),Ny=Oy({name:"TransitionGroup",props:ze({},qf,{tag:String,moveClass:String}),setup(e,{slots:t}){const s=as(),n=rc();let a,i;return wr(()=>{if(!a.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!Fy(a[0].el,s.vnode.el,l)){a=[];return}a.forEach(Dy),a.forEach(My);const r=a.filter(Py);Io(s.vnode.el),r.forEach(o=>{const c=o.el,d=c.style;Ws(c,l),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[Wl]=p=>{p&&p.target!==c||(!p||p.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",u),c[Wl]=null,Ln(c,l))};c.addEventListener("transitionend",u)}),a=[]}),()=>{const l=Je(e),r=Gf(l);let o=l.tag||Dt;if(a=[],i)for(let c=0;c{r.split(/\s+/).forEach(o=>o&&n.classList.remove(o))}),s.split(/\s+/).forEach(r=>r&&n.classList.add(r)),n.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(n);const{hasTransform:l}=Kf(n);return i.removeChild(n),l}const Bn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ye(t)?s=>Ma(t,s):t};function $y(e){e.target.composing=!0}function Vd(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ns=Symbol("_assign");function jd(e,t,s){return t&&(e=e.trim()),s&&(e=fr(e)),e}const Zl={created(e,{modifiers:{lazy:t,trim:s,number:n}},a){e[Ns]=Bn(a);const i=n||a.props&&a.props.type==="number";mn(e,t?"change":"input",l=>{l.target.composing||e[Ns](jd(e.value,s,i))}),(s||i)&&mn(e,"change",()=>{e.value=jd(e.value,s,i)}),t||(mn(e,"compositionstart",$y),mn(e,"compositionend",Vd),mn(e,"change",Vd))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:a,number:i}},l){if(e[Ns]=Bn(l),e.composing)return;const r=(i||e.type==="number")&&!/^0\d/.test(e.value)?fr(e.value):e.value,o=t??"";if(r===o)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(n&&t===s||a&&e.value.trim()===o)||(e.value=o)}},kc={deep:!0,created(e,t,s){e[Ns]=Bn(s),mn(e,"change",()=>{const n=e._modelValue,a=Ga(e),i=e.checked,l=e[Ns];if(ye(n)){const r=mr(n,a),o=r!==-1;if(i&&!o)l(n.concat(a));else if(!i&&o){const c=[...n];c.splice(r,1),l(c)}}else if(da(n)){const r=new Set(n);i?r.add(a):r.delete(a),l(r)}else l(nh(e,i))})},mounted:qd,beforeUpdate(e,t,s){e[Ns]=Bn(s),qd(e,t,s)}};function qd(e,{value:t,oldValue:s},n){e._modelValue=t;let a;if(ye(t))a=mr(t,n.props.value)>-1;else if(da(t))a=t.has(n.props.value);else{if(t===s)return;a=kn(t,nh(e,!0))}e.checked!==a&&(e.checked=a)}const wc={created(e,{value:t},s){e.checked=kn(t,s.props.value),e[Ns]=Bn(s),mn(e,"change",()=>{e[Ns](Ga(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[Ns]=Bn(n),t!==s&&(e.checked=kn(t,n.props.value))}},sh={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const a=da(t);mn(e,"change",()=>{const i=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?fr(Ga(l)):Ga(l));e[Ns](e.multiple?a?new Set(i):i:i[0]),e._assigning=!0,Rt(()=>{e._assigning=!1})}),e[Ns]=Bn(n)},mounted(e,{value:t}){Gd(e,t)},beforeUpdate(e,t,s){e[Ns]=Bn(s)},updated(e,{value:t}){e._assigning||Gd(e,t)}};function Gd(e,t){const s=e.multiple,n=ye(t);if(!(s&&!n&&!da(t))){for(let a=0,i=e.options.length;aString(c)===String(r)):l.selected=mr(t,r)>-1}else l.selected=t.has(r);else if(kn(Ga(l),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ga(e){return"_value"in e?e._value:e.value}function nh(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const ah={created(e,t,s){bl(e,t,s,null,"created")},mounted(e,t,s){bl(e,t,s,null,"mounted")},beforeUpdate(e,t,s,n){bl(e,t,s,n,"beforeUpdate")},updated(e,t,s,n){bl(e,t,s,n,"updated")}};function ih(e,t){switch(e){case"SELECT":return sh;case"TEXTAREA":return Zl;default:switch(t){case"checkbox":return kc;case"radio":return wc;default:return Zl}}}function bl(e,t,s,n,a){const l=ih(e.tagName,s.props&&s.props.type)[a];l&&l(e,t,s,n)}function Uy(){Zl.getSSRProps=({value:e})=>({value:e}),wc.getSSRProps=({value:e},t)=>{if(t.props&&kn(t.props.value,e))return{checked:!0}},kc.getSSRProps=({value:e},t)=>{if(ye(e)){if(t.props&&mr(e,t.props.value)>-1)return{checked:!0}}else if(da(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},ah.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const s=ih(t.type.toUpperCase(),t.props&&t.props.type);if(s.getSSRProps)return s.getSSRProps(e,t)}}const By=["ctrl","shift","alt","meta"],Hy={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>By.some(s=>e[`${s}Key`]&&!t.includes(s))},zy=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((a,...i)=>{for(let l=0;l{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(a=>{if(!("key"in a))return;const i=fs(a.key);if(t.some(l=>l===i||Vy[l]===i))return e(a)}))},lh=ze({patchProp:Jf},Vf);let Ci,Kd=!1;function rh(){return Ci||(Ci=xf(lh))}function oh(){return Ci=Kd?Ci:_f(lh),Kd=!0,Ci}const ch=((...e)=>{rh().render(...e)}),qy=((...e)=>{oh().hydrate(...e)}),Jl=((...e)=>{const t=rh().createApp(...e),{mount:s}=t;return t.mount=n=>{const a=ph(n);if(!a)return;const i=t._component;!Ie(i)&&!i.render&&!i.template&&(i.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const l=s(a,!1,uh(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),l},t}),dh=((...e)=>{const t=oh().createApp(...e),{mount:s}=t;return t.mount=n=>{const a=ph(n);if(a)return s(a,!0,uh(a))},t});function uh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ph(e){return Me(e)?document.querySelector(e):e}let Wd=!1;const Gy=()=>{Wd||(Wd=!0,Uy(),fy())},Ky=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:Jp,BaseTransitionPropsValidators:oc,Comment:yt,DeprecationTypes:iy,EffectScope:Qo,ErrorCodes:ov,ErrorTypeStrings:Qb,Fragment:Dt,KeepAlive:Hv,ReactiveEffect:Ni,Static:sa,Suspense:Lb,Teleport:wv,Text:$n,TrackOpTypes:tv,Transition:cy,TransitionGroup:Ly,TriggerOpTypes:sv,VueElement:Er,assertNumber:rv,callWithAsyncErrorHandling:xs,callWithErrorHandling:ti,camelize:it,capitalize:ua,cloneVNode:sn,compatUtils:ay,computed:J,createApp:Jl,createBlock:Vl,createCommentVNode:Nf,createElementBlock:Ub,createElementVNode:bc,createHydrationRenderer:_f,createPropsRestProxy:cb,createRenderer:xf,createSSRApp:dh,createSlots:Wv,createStaticVNode:zb,createTextVNode:yc,createVNode:pt,customRef:Dp,defineAsyncComponent:Uv,defineComponent:el,defineCustomElement:Yf,defineEmits:Xv,defineExpose:eb,defineModel:nb,defineOptions:tb,defineProps:Qv,defineSSRCustomElement:Ey,defineSlots:sb,devtools:Xb,effect:Sg,effectScope:_g,getCurrentInstance:as,getCurrentScope:gp,getCurrentWatcher:nv,getTransitionRawChildren:_r,guardReactiveProps:Of,h:ja,handleError:pa,hasInjectionContext:gv,hydrate:qy,hydrateOnIdle:Lv,hydrateOnInteraction:Fv,hydrateOnMediaQuery:Pv,hydrateOnVisible:Mv,initCustomFormatter:Zb,initDirectivesForSSR:Gy,inject:Os,isMemoSame:Bf,isProxy:Qi,isReactive:yn,isReadonly:tn,isRef:St,isRuntimeOnly:Gb,isShallow:ms,isVNode:Cn,markRaw:Np,mergeDefaults:rb,mergeModels:ob,mergeProps:Lf,nextTick:Rt,nodeOps:Vf,normalizeClass:Yi,normalizeProps:og,normalizeStyle:Ji,onActivated:Ds,onBeforeMount:Xp,onBeforeUnmount:Sr,onBeforeUpdate:dc,onDeactivated:Ms,onErrorCaptured:nf,onMounted:We,onRenderTracked:sf,onRenderTriggered:tf,onScopeDispose:kg,onServerPrefetch:ef,onUnmounted:xt,onUpdated:wr,onWatcherCleanup:Pp,openBlock:Bi,patchProp:Jf,popScopeId:fv,provide:wi,proxyRefs:ac,pushScopeId:pv,queuePostFlushCb:Mi,reactive:Hn,readonly:Ml,ref:h,registerRuntimeCompiler:Ff,render:ch,renderList:Kv,renderSlot:Zv,resolveComponent:jv,resolveDirective:Gv,resolveDynamicComponent:qv,resolveFilter:ny,resolveTransitionHooks:Va,setBlockTracking:Hi,setDevtoolsHook:ey,setTransitionHooks:Tn,shallowReactive:sc,shallowReadonly:Vg,shallowRef:nc,ssrContextKey:zp,ssrUtils:sy,stop:Tg,toDisplayString:hp,toHandlerKey:Da,toHandlers:Jv,toRaw:Je,toRef:Qg,toRefs:Zg,toValue:Gg,transformVNodeArgs:Bb,triggerRef:qg,unref:en,useAttrs:lb,useCssModule:Iy,useCssVars:hy,useHost:Qf,useId:Tv,useModel:bb,useSSRContext:Vp,useShadowRoot:Ry,useSlots:ib,useTemplateRef:Cv,useTransitionState:rc,vModelCheckbox:kc,vModelDynamic:ah,vModelRadio:wc,vModelSelect:sh,vModelText:Zl,vShow:Wf,version:Hf,warn:Yb,watch:ns,watchEffect:vv,watchPostEffect:bv,watchSyncEffect:jp,withAsyncContext:db,withCtx:lc,withDefaults:ab,withDirectives:mv,withKeys:jy,withMemo:Jb,withModifiers:zy,withScopeId:hv},Symbol.toStringTag,{value:"Module"}));/** * @vue/compiler-core v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const Vi=Symbol(""),Ei=Symbol(""),Sc=Symbol(""),Yl=Symbol(""),ph=Symbol(""),ra=Symbol(""),hh=Symbol(""),mh=Symbol(""),Tc=Symbol(""),Cc=Symbol(""),nl=Symbol(""),Ec=Symbol(""),gh=Symbol(""),Ac=Symbol(""),Rc=Symbol(""),Ic=Symbol(""),Oc=Symbol(""),Nc=Symbol(""),Lc=Symbol(""),vh=Symbol(""),bh=Symbol(""),Ar=Symbol(""),Ql=Symbol(""),Dc=Symbol(""),Mc=Symbol(""),ji=Symbol(""),al=Symbol(""),Pc=Symbol(""),No=Symbol(""),Wy=Symbol(""),Lo=Symbol(""),Xl=Symbol(""),Zy=Symbol(""),Jy=Symbol(""),Fc=Symbol(""),Yy=Symbol(""),Qy=Symbol(""),$c=Symbol(""),yh=Symbol(""),Ka={[Vi]:"Fragment",[Ei]:"Teleport",[Sc]:"Suspense",[Yl]:"KeepAlive",[ph]:"BaseTransition",[ra]:"openBlock",[hh]:"createBlock",[mh]:"createElementBlock",[Tc]:"createVNode",[Cc]:"createElementVNode",[nl]:"createCommentVNode",[Ec]:"createTextVNode",[gh]:"createStaticVNode",[Ac]:"resolveComponent",[Rc]:"resolveDynamicComponent",[Ic]:"resolveDirective",[Oc]:"resolveFilter",[Nc]:"withDirectives",[Lc]:"renderList",[vh]:"renderSlot",[bh]:"createSlots",[Ar]:"toDisplayString",[Ql]:"mergeProps",[Dc]:"normalizeClass",[Mc]:"normalizeStyle",[ji]:"normalizeProps",[al]:"guardReactiveProps",[Pc]:"toHandlers",[No]:"camelize",[Wy]:"capitalize",[Lo]:"toHandlerKey",[Xl]:"setBlockTracking",[Zy]:"pushScopeId",[Jy]:"popScopeId",[Fc]:"withCtx",[Yy]:"unref",[Qy]:"isRef",[$c]:"withMemo",[yh]:"isMemoSame"};function Xy(e){Object.getOwnPropertySymbols(e).forEach(t=>{Ka[t]=e[t]})}const ws={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function ex(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:ws}}function qi(e,t,s,n,a,i,l,r=!1,o=!1,c=!1,d=ws){return e&&(r?(e.helper(ra),e.helper(Ja(e.inSSR,c))):e.helper(Za(e.inSSR,c)),l&&e.helper(Nc)),{type:13,tag:t,props:s,children:n,patchFlag:a,dynamicProps:i,directives:l,isBlock:r,disableTracking:o,isComponent:c,loc:d}}function na(e,t=ws){return{type:17,loc:t,elements:e}}function Is(e,t=ws){return{type:15,loc:t,properties:e}}function wt(e,t){return{type:16,loc:ws,key:Me(e)?Fe(e,!0):e,value:t}}function Fe(e,t=!1,s=ws,n=0){return{type:4,loc:s,content:e,isStatic:t,constType:t?3:n}}function Vs(e,t=ws){return{type:8,loc:t,children:e}}function It(e,t=[],s=ws){return{type:14,loc:s,callee:e,arguments:t}}function Wa(e,t=void 0,s=!1,n=!1,a=ws){return{type:18,params:e,returns:t,newline:s,isSlot:n,loc:a}}function Do(e,t,s,n=!0){return{type:19,test:e,consequent:t,alternate:s,newline:n,loc:ws}}function tx(e,t,s=!1,n=!1){return{type:20,index:e,value:t,needPauseTracking:s,inVOnce:n,needArraySpread:!1,loc:ws}}function sx(e){return{type:21,body:e,loc:ws}}function Za(e,t){return e||t?Tc:Cc}function Ja(e,t){return e||t?hh:mh}function Bc(e,{helper:t,removeHelper:s,inSSR:n}){e.isBlock||(e.isBlock=!0,s(Za(n,e.isComponent)),t(ra),t(Ja(n,e.isComponent)))}const Zd=new Uint8Array([123,123]),Jd=new Uint8Array([125,125]);function Yd(e){return e>=97&&e<=122||e>=65&&e<=90}function bs(e){return e===32||e===10||e===9||e===12||e===13}function In(e){return e===47||e===62||bs(e)}function er(e){const t=new Uint8Array(e.length);for(let s=0;s100){let l=-1,r=a;for(;l+1>>1;this.newlines[o]=0;l--)if(t>this.newlines[l]){i=l;break}return i>=0&&(s=i+2,n=t-this.newlines[i]),{column:n,line:s,offset:t}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(t){t===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t))}stateInterpolationOpen(t){if(t===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const s=this.index+1-this.delimiterOpen.length;s>this.sectionStart&&this.cbs.ontext(this.sectionStart,s),this.state=3,this.sectionStart=s}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(t)):(this.state=1,this.stateText(t))}stateInterpolation(t){t===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(t))}stateInterpolationClose(t){t===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(t))}stateSpecialStartSequence(t){const s=this.sequenceIndex===this.currentSequence.length;if(!(s?In(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!s){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(t)}stateInRCDATA(t){if(this.sequenceIndex===this.currentSequence.length){if(t===62||bs(t)){const s=this.index-this.currentSequence.length;if(this.sectionStart=t||(this.state===28?this.currentSequence===jt.CdataEnd?this.cbs.oncdata(this.sectionStart,t):this.cbs.oncomment(this.sectionStart,t):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,s){}}function Qd(e,{compatConfig:t}){const s=t&&t[e];return e==="MODE"?s||3:s}function aa(e,t){const s=Qd("MODE",t),n=Qd(e,t);return s===3?n===!0:n!==!1}function Gi(e,t,s,...n){return aa(e,t)}function Uc(e){throw e}function xh(e){}function ut(e,t,s,n){const a=`https://vuejs.org/error-reference/#compiler-${e}`,i=new SyntaxError(String(a));return i.code=e,i.loc=t,i}const hs=e=>e.type===4&&e.isStatic;function _h(e){switch(e){case"Teleport":case"teleport":return Ei;case"Suspense":case"suspense":return Sc;case"KeepAlive":case"keep-alive":return Yl;case"BaseTransition":case"base-transition":return ph}}const ax=/^$|^\d|[^\$\w\xA0-\uFFFF]/,Hc=e=>!ax.test(e),kh=/[A-Za-z_$\xA0-\uFFFF]/,ix=/[\.\?\w$\xA0-\uFFFF]/,lx=/\s+[.[]\s*|\s*[.[]\s+/g,wh=e=>e.type===4?e.content:e.loc.source,rx=e=>{const t=wh(e).trim().replace(lx,r=>r.trim());let s=0,n=[],a=0,i=0,l=null;for(let r=0;r|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,cx=e=>ox.test(wh(e)),dx=cx;function Rs(e,t,s=!1){for(let n=0;nt.type===7&&t.name==="bind"&&(!t.arg||t.arg.type!==4||!t.arg.isStatic))}function Yr(e){return e.type===5||e.type===2}function Xd(e){return e.type===7&&e.name==="pre"}function fx(e){return e.type===7&&e.name==="slot"}function tr(e){return e.type===1&&e.tagType===3}function sr(e){return e.type===1&&e.tagType===2}const px=new Set([ji,al]);function Th(e,t=[]){if(e&&!Me(e)&&e.type===14){const s=e.callee;if(!Me(s)&&px.has(s))return Th(e.arguments[0],t.concat(e))}return[e,t]}function nr(e,t,s){let n,a=e.type===13?e.props:e.arguments[2],i=[],l;if(a&&!Me(a)&&a.type===14){const r=Th(a);a=r[0],i=r[1],l=i[i.length-1]}if(a==null||Me(a))n=Is([t]);else if(a.type===14){const r=a.arguments[0];!Me(r)&&r.type===15?eu(t,r)||r.properties.unshift(t):a.callee===Pc?n=It(s.helper(Ql),[Is([t]),a]):a.arguments.unshift(Is([t])),!n&&(n=a)}else a.type===15?(eu(t,a)||a.properties.unshift(t),n=a):(n=It(s.helper(Ql),[Is([t]),a]),l&&l.callee===al&&(l=i[i.length-2]));e.type===13?l?l.arguments[0]=n:e.props=n:l?l.arguments[0]=n:e.arguments[2]=n}function eu(e,t){let s=!1;if(e.key.type===4){const n=e.key.content;s=t.properties.some(a=>a.key.type===4&&a.key.content===n)}return s}function Ki(e,t){return`_${t}_${e.replace(/[^\w]/g,(s,n)=>s==="-"?"_":e.charCodeAt(n).toString())}`}function hx(e){return e.type===14&&e.callee===$c?e.arguments[1].returns:e}const mx=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Ch(e){for(let t=0;t0,isVoidTag:Ia,isPreTag:Ia,isIgnoreNewlineTag:Ia,isCustomElement:Ia,onError:Uc,onWarn:xh,comments:!1,prefixIdentifiers:!1};let Qe=Ah,Wi=null,_n="",Gt=null,Ge=null,cs="",cn=-1,Wn=-1,Vc=0,Pn=!1,Mo=null;const dt=[],gt=new nx(dt,{onerr:ln,ontext(e,t){yl($t(e,t),e,t)},ontextentity(e,t,s){yl(e,t,s)},oninterpolation(e,t){if(Pn)return yl($t(e,t),e,t);let s=e+gt.delimiterOpen.length,n=t-gt.delimiterClose.length;for(;bs(_n.charCodeAt(s));)s++;for(;bs(_n.charCodeAt(n-1));)n--;let a=$t(s,n);a.includes("&")&&(a=Qe.decodeEntities(a,!1)),Po({type:5,content:Rl(a,!1,bt(s,n)),loc:bt(e,t)})},onopentagname(e,t){const s=$t(e,t);Gt={type:1,tag:s,ns:Qe.getNamespace(s,dt[0],Qe.ns),tagType:0,props:[],children:[],loc:bt(e-1,t),codegenNode:void 0}},onopentagend(e){su(e)},onclosetag(e,t){const s=$t(e,t);if(!Qe.isVoidTag(s)){let n=!1;for(let a=0;a0&&ln(24,dt[0].loc.start.offset);for(let l=0;l<=a;l++){const r=dt.shift();Al(r,t,l(n.type===7?n.rawName:n.name)===s)&&ln(2,t)},onattribend(e,t){if(Gt&&Ge){if(Qn(Ge.loc,t),e!==0)if(cs.includes("&")&&(cs=Qe.decodeEntities(cs,!0)),Ge.type===6)Ge.name==="class"&&(cs=Oh(cs).trim()),e===1&&!cs&&ln(13,t),Ge.value={type:2,content:cs,loc:e===1?bt(cn,Wn):bt(cn-1,Wn+1)},gt.inSFCRoot&&Gt.tag==="template"&&Ge.name==="lang"&&cs&&cs!=="html"&>.enterRCDATA(er("a.content==="sync"))>-1&&Gi("COMPILER_V_BIND_SYNC",Qe,Ge.loc,Ge.arg.loc.source)&&(Ge.name="model",Ge.modifiers.splice(n,1))}(Ge.type!==7||Ge.name!=="pre")&&Gt.props.push(Ge)}cs="",cn=Wn=-1},oncomment(e,t){Qe.comments&&Po({type:3,content:$t(e,t),loc:bt(e-4,t+3)})},onend(){const e=_n.length;for(let t=0;t{const b=t.start.offset+f,y=b+u.length;return Rl(u,!1,bt(b,y),0,p?1:0)},r={source:l(i.trim(),s.indexOf(i,a.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let o=a.trim().replace(gx,"").trim();const c=a.indexOf(o),d=o.match(tu);if(d){o=o.replace(tu,"").trim();const u=d[1].trim();let f;if(u&&(f=s.indexOf(u,c+o.length),r.key=l(u,f,!0)),d[2]){const p=d[2].trim();p&&(r.index=l(p,s.indexOf(p,r.key?f+u.length:c+o.length),!0))}}return o&&(r.value=l(o,c,!0)),r}function $t(e,t){return _n.slice(e,t)}function su(e){gt.inSFCRoot&&(Gt.innerLoc=bt(e+1,e+1)),Po(Gt);const{tag:t,ns:s}=Gt;s===0&&Qe.isPreTag(t)&&Vc++,Qe.isVoidTag(t)?Al(Gt,e):(dt.unshift(Gt),(s===1||s===2)&&(gt.inXML=!0)),Gt=null}function yl(e,t,s){{const i=dt[0]&&dt[0].tag;i!=="script"&&i!=="style"&&e.includes("&")&&(e=Qe.decodeEntities(e,!1))}const n=dt[0]||Wi,a=n.children[n.children.length-1];a&&a.type===2?(a.content+=e,Qn(a.loc,s)):n.children.push({type:2,content:e,loc:bt(t,s)})}function Al(e,t,s=!1){s?Qn(e.loc,Rh(t,60)):Qn(e.loc,bx(t,62)+1),gt.inSFCRoot&&(e.children.length?e.innerLoc.end=ze({},e.children[e.children.length-1].loc.end):e.innerLoc.end=ze({},e.innerLoc.start),e.innerLoc.source=$t(e.innerLoc.start.offset,e.innerLoc.end.offset));const{tag:n,ns:a,children:i}=e;if(Pn||(n==="slot"?e.tagType=2:nu(e)?e.tagType=3:xx(e)&&(e.tagType=1)),gt.inRCDATA||(e.children=Ih(i)),a===0&&Qe.isIgnoreNewlineTag(n)){const l=i[0];l&&l.type===2&&(l.content=l.content.replace(/^\r?\n/,""))}a===0&&Qe.isPreTag(n)&&Vc--,Mo===e&&(Pn=gt.inVPre=!1,Mo=null),gt.inXML&&(dt[0]?dt[0].ns:Qe.ns)===0&&(gt.inXML=!1);{const l=e.props;if(!gt.inSFCRoot&&aa("COMPILER_NATIVE_TEMPLATE",Qe)&&e.tag==="template"&&!nu(e)){const o=dt[0]||Wi,c=o.children.indexOf(e);o.children.splice(c,1,...e.children)}const r=l.find(o=>o.type===6&&o.name==="inline-template");r&&Gi("COMPILER_INLINE_TEMPLATE",Qe,r.loc)&&e.children.length&&(r.value={type:2,content:$t(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:r.loc})}}function bx(e,t){let s=e;for(;_n.charCodeAt(s)!==t&&s<_n.length-1;)s++;return s}function Rh(e,t){let s=e;for(;_n.charCodeAt(s)!==t&&s>=0;)s--;return s}const yx=new Set(["if","else","else-if","for","slot"]);function nu({tag:e,props:t}){if(e==="template"){for(let s=0;s64&&e<91}const kx=/\r\n/g;function Ih(e){const t=Qe.whitespace!=="preserve";let s=!1;for(let n=0;ns.type!==3);return t.length===1&&t[0].type===1&&!sr(t[0])?t[0]:null}function Il(e,t,s,n=!1,a=!1){const{children:i}=e,l=[];for(let d=0;d0){if(f>=2){u.codegenNode.patchFlag=-1,l.push(u);continue}}else{const p=u.codegenNode;if(p.type===13){const b=p.patchFlag;if((b===void 0||b===512||b===1)&&Dh(u,s)>=2){const y=Mh(u);y&&(p.props=s.hoist(y))}p.dynamicProps&&(p.dynamicProps=s.hoist(p.dynamicProps))}}}else if(u.type===12&&(n?0:ys(u,s))>=2){u.codegenNode.type===14&&u.codegenNode.arguments.length>0&&u.codegenNode.arguments.push("-1"),l.push(u);continue}if(u.type===1){const f=u.tagType===1;f&&s.scopes.vSlot++,Il(u,e,s,!1,a),f&&s.scopes.vSlot--}else if(u.type===11)Il(u,e,s,u.children.length===1,!0);else if(u.type===9)for(let f=0;fp.key===u||p.key.content===u);return f&&f.value}}l.length&&s.transformHoist&&s.transformHoist(i,s,e)}function ys(e,t){const{constantCache:s}=t;switch(e.type){case 1:if(e.tagType!==0)return 0;const n=s.get(e);if(n!==void 0)return n;const a=e.codegenNode;if(a.type!==13||a.isBlock&&e.tag!=="svg"&&e.tag!=="foreignObject"&&e.tag!=="math")return 0;if(a.patchFlag===void 0){let l=3;const r=Dh(e,t);if(r===0)return s.set(e,0),0;r1)for(let o=0;oH&&(T.childIndex--,T.onNodeRemoved()),T.parent.children.splice(H,1)},onNodeRemoved:Ht,addIdentifiers(C){},removeIdentifiers(C){},hoist(C){Me(C)&&(C=Fe(C)),T.hoists.push(C);const M=Fe(`_hoisted_${T.hoists.length}`,!1,C.loc,2);return M.hoisted=C,M},cache(C,M=!1,H=!1){const P=tx(T.cached.length,C,M,H);return T.cached.push(P),P}};return T.filters=new Set,T}function Ox(e,t){const s=Ix(e,t);Ir(e,s),t.hoistStatic&&Ax(e,s),t.ssr||Nx(e,s),e.helpers=new Set([...s.helpers.keys()]),e.components=[...s.components],e.directives=[...s.directives],e.imports=s.imports,e.hoists=s.hoists,e.temps=s.temps,e.cached=s.cached,e.transformed=!0,e.filters=[...s.filters]}function Nx(e,t){const{helper:s}=t,{children:n}=e;if(n.length===1){const a=Nh(e);if(a&&a.codegenNode){const i=a.codegenNode;i.type===13&&Bc(i,t),e.codegenNode=i}else e.codegenNode=n[0]}else if(n.length>1){let a=64;e.codegenNode=qi(t,s(Vi),void 0,e.children,a,void 0,void 0,!0,void 0,!1)}}function Lx(e,t){let s=0;const n=()=>{s--};for(;sn===e:n=>e.test(n);return(n,a)=>{if(n.type===1){const{props:i}=n;if(n.tagType===3&&i.some(fx))return;const l=[];for(let r=0;r`${Ka[e]}: _${Ka[e]}`;function Dx(e,{mode:t="function",prefixIdentifiers:s=t==="module",sourceMap:n=!1,filename:a="template.vue.html",scopeId:i=null,optimizeImports:l=!1,runtimeGlobalName:r="Vue",runtimeModuleName:o="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:d=!1,isTS:u=!1,inSSR:f=!1}){const p={mode:t,prefixIdentifiers:s,sourceMap:n,filename:a,scopeId:i,optimizeImports:l,runtimeGlobalName:r,runtimeModuleName:o,ssrRuntimeModuleName:c,ssr:d,isTS:u,inSSR:f,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(y){return`_${Ka[y]}`},push(y,E=-2,I){p.code+=y},indent(){b(++p.indentLevel)},deindent(y=!1){y?--p.indentLevel:b(--p.indentLevel)},newline(){b(p.indentLevel)}};function b(y){p.push(` -`+" ".repeat(y),0)}return p}function Mx(e,t={}){const s=Dx(e,t);t.onContextCreated&&t.onContextCreated(s);const{mode:n,push:a,prefixIdentifiers:i,indent:l,deindent:r,newline:o,scopeId:c,ssr:d}=s,u=Array.from(e.helpers),f=u.length>0,p=!i&&n!=="module";Px(e,s);const y=d?"ssrRender":"render",I=(d?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(a(`function ${y}(${I}) {`),l(),p&&(a("with (_ctx) {"),l(),f&&(a(`const { ${u.map(Fh).join(", ")} } = _Vue +**/const Vi=Symbol(""),Ei=Symbol(""),Sc=Symbol(""),Yl=Symbol(""),fh=Symbol(""),ra=Symbol(""),hh=Symbol(""),mh=Symbol(""),Tc=Symbol(""),Cc=Symbol(""),nl=Symbol(""),Ec=Symbol(""),gh=Symbol(""),Ac=Symbol(""),Rc=Symbol(""),Ic=Symbol(""),Oc=Symbol(""),Nc=Symbol(""),Lc=Symbol(""),vh=Symbol(""),bh=Symbol(""),Ar=Symbol(""),Ql=Symbol(""),Dc=Symbol(""),Mc=Symbol(""),ji=Symbol(""),al=Symbol(""),Pc=Symbol(""),No=Symbol(""),Wy=Symbol(""),Lo=Symbol(""),Xl=Symbol(""),Zy=Symbol(""),Jy=Symbol(""),Fc=Symbol(""),Yy=Symbol(""),Qy=Symbol(""),$c=Symbol(""),yh=Symbol(""),Ka={[Vi]:"Fragment",[Ei]:"Teleport",[Sc]:"Suspense",[Yl]:"KeepAlive",[fh]:"BaseTransition",[ra]:"openBlock",[hh]:"createBlock",[mh]:"createElementBlock",[Tc]:"createVNode",[Cc]:"createElementVNode",[nl]:"createCommentVNode",[Ec]:"createTextVNode",[gh]:"createStaticVNode",[Ac]:"resolveComponent",[Rc]:"resolveDynamicComponent",[Ic]:"resolveDirective",[Oc]:"resolveFilter",[Nc]:"withDirectives",[Lc]:"renderList",[vh]:"renderSlot",[bh]:"createSlots",[Ar]:"toDisplayString",[Ql]:"mergeProps",[Dc]:"normalizeClass",[Mc]:"normalizeStyle",[ji]:"normalizeProps",[al]:"guardReactiveProps",[Pc]:"toHandlers",[No]:"camelize",[Wy]:"capitalize",[Lo]:"toHandlerKey",[Xl]:"setBlockTracking",[Zy]:"pushScopeId",[Jy]:"popScopeId",[Fc]:"withCtx",[Yy]:"unref",[Qy]:"isRef",[$c]:"withMemo",[yh]:"isMemoSame"};function Xy(e){Object.getOwnPropertySymbols(e).forEach(t=>{Ka[t]=e[t]})}const ws={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function ex(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:ws}}function qi(e,t,s,n,a,i,l,r=!1,o=!1,c=!1,d=ws){return e&&(r?(e.helper(ra),e.helper(Ja(e.inSSR,c))):e.helper(Za(e.inSSR,c)),l&&e.helper(Nc)),{type:13,tag:t,props:s,children:n,patchFlag:a,dynamicProps:i,directives:l,isBlock:r,disableTracking:o,isComponent:c,loc:d}}function na(e,t=ws){return{type:17,loc:t,elements:e}}function Is(e,t=ws){return{type:15,loc:t,properties:e}}function wt(e,t){return{type:16,loc:ws,key:Me(e)?$e(e,!0):e,value:t}}function $e(e,t=!1,s=ws,n=0){return{type:4,loc:s,content:e,isStatic:t,constType:t?3:n}}function Vs(e,t=ws){return{type:8,loc:t,children:e}}function It(e,t=[],s=ws){return{type:14,loc:s,callee:e,arguments:t}}function Wa(e,t=void 0,s=!1,n=!1,a=ws){return{type:18,params:e,returns:t,newline:s,isSlot:n,loc:a}}function Do(e,t,s,n=!0){return{type:19,test:e,consequent:t,alternate:s,newline:n,loc:ws}}function tx(e,t,s=!1,n=!1){return{type:20,index:e,value:t,needPauseTracking:s,inVOnce:n,needArraySpread:!1,loc:ws}}function sx(e){return{type:21,body:e,loc:ws}}function Za(e,t){return e||t?Tc:Cc}function Ja(e,t){return e||t?hh:mh}function Uc(e,{helper:t,removeHelper:s,inSSR:n}){e.isBlock||(e.isBlock=!0,s(Za(n,e.isComponent)),t(ra),t(Ja(n,e.isComponent)))}const Zd=new Uint8Array([123,123]),Jd=new Uint8Array([125,125]);function Yd(e){return e>=97&&e<=122||e>=65&&e<=90}function bs(e){return e===32||e===10||e===9||e===12||e===13}function In(e){return e===47||e===62||bs(e)}function er(e){const t=new Uint8Array(e.length);for(let s=0;s100){let l=-1,r=a;for(;l+1>>1;this.newlines[o]=0;l--)if(t>this.newlines[l]){i=l;break}return i>=0&&(s=i+2,n=t-this.newlines[i]),{column:n,line:s,offset:t}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(t){t===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t))}stateInterpolationOpen(t){if(t===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const s=this.index+1-this.delimiterOpen.length;s>this.sectionStart&&this.cbs.ontext(this.sectionStart,s),this.state=3,this.sectionStart=s}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(t)):(this.state=1,this.stateText(t))}stateInterpolation(t){t===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(t))}stateInterpolationClose(t){t===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(t))}stateSpecialStartSequence(t){const s=this.sequenceIndex===this.currentSequence.length;if(!(s?In(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!s){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(t)}stateInRCDATA(t){if(this.sequenceIndex===this.currentSequence.length){if(t===62||bs(t)){const s=this.index-this.currentSequence.length;if(this.sectionStart=t||(this.state===28?this.currentSequence===jt.CdataEnd?this.cbs.oncdata(this.sectionStart,t):this.cbs.oncomment(this.sectionStart,t):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,s){}}function Qd(e,{compatConfig:t}){const s=t&&t[e];return e==="MODE"?s||3:s}function aa(e,t){const s=Qd("MODE",t),n=Qd(e,t);return s===3?n===!0:n!==!1}function Gi(e,t,s,...n){return aa(e,t)}function Bc(e){throw e}function xh(e){}function ut(e,t,s,n){const a=`https://vuejs.org/error-reference/#compiler-${e}`,i=new SyntaxError(String(a));return i.code=e,i.loc=t,i}const hs=e=>e.type===4&&e.isStatic;function _h(e){switch(e){case"Teleport":case"teleport":return Ei;case"Suspense":case"suspense":return Sc;case"KeepAlive":case"keep-alive":return Yl;case"BaseTransition":case"base-transition":return fh}}const ax=/^$|^\d|[^\$\w\xA0-\uFFFF]/,Hc=e=>!ax.test(e),kh=/[A-Za-z_$\xA0-\uFFFF]/,ix=/[\.\?\w$\xA0-\uFFFF]/,lx=/\s+[.[]\s*|\s*[.[]\s+/g,wh=e=>e.type===4?e.content:e.loc.source,rx=e=>{const t=wh(e).trim().replace(lx,r=>r.trim());let s=0,n=[],a=0,i=0,l=null;for(let r=0;r|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/,cx=e=>ox.test(wh(e)),dx=cx;function Rs(e,t,s=!1){for(let n=0;nt.type===7&&t.name==="bind"&&(!t.arg||t.arg.type!==4||!t.arg.isStatic))}function Yr(e){return e.type===5||e.type===2}function Xd(e){return e.type===7&&e.name==="pre"}function px(e){return e.type===7&&e.name==="slot"}function tr(e){return e.type===1&&e.tagType===3}function sr(e){return e.type===1&&e.tagType===2}const fx=new Set([ji,al]);function Th(e,t=[]){if(e&&!Me(e)&&e.type===14){const s=e.callee;if(!Me(s)&&fx.has(s))return Th(e.arguments[0],t.concat(e))}return[e,t]}function nr(e,t,s){let n,a=e.type===13?e.props:e.arguments[2],i=[],l;if(a&&!Me(a)&&a.type===14){const r=Th(a);a=r[0],i=r[1],l=i[i.length-1]}if(a==null||Me(a))n=Is([t]);else if(a.type===14){const r=a.arguments[0];!Me(r)&&r.type===15?eu(t,r)||r.properties.unshift(t):a.callee===Pc?n=It(s.helper(Ql),[Is([t]),a]):a.arguments.unshift(Is([t])),!n&&(n=a)}else a.type===15?(eu(t,a)||a.properties.unshift(t),n=a):(n=It(s.helper(Ql),[Is([t]),a]),l&&l.callee===al&&(l=i[i.length-2]));e.type===13?l?l.arguments[0]=n:e.props=n:l?l.arguments[0]=n:e.arguments[2]=n}function eu(e,t){let s=!1;if(e.key.type===4){const n=e.key.content;s=t.properties.some(a=>a.key.type===4&&a.key.content===n)}return s}function Ki(e,t){return`_${t}_${e.replace(/[^\w]/g,(s,n)=>s==="-"?"_":e.charCodeAt(n).toString())}`}function hx(e){return e.type===14&&e.callee===$c?e.arguments[1].returns:e}const mx=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;function Ch(e){for(let t=0;t0,isVoidTag:Ia,isPreTag:Ia,isIgnoreNewlineTag:Ia,isCustomElement:Ia,onError:Bc,onWarn:xh,comments:!1,prefixIdentifiers:!1};let Qe=Ah,Wi=null,_n="",Gt=null,Ge=null,cs="",cn=-1,Wn=-1,Vc=0,Pn=!1,Mo=null;const dt=[],gt=new nx(dt,{onerr:ln,ontext(e,t){yl($t(e,t),e,t)},ontextentity(e,t,s){yl(e,t,s)},oninterpolation(e,t){if(Pn)return yl($t(e,t),e,t);let s=e+gt.delimiterOpen.length,n=t-gt.delimiterClose.length;for(;bs(_n.charCodeAt(s));)s++;for(;bs(_n.charCodeAt(n-1));)n--;let a=$t(s,n);a.includes("&")&&(a=Qe.decodeEntities(a,!1)),Po({type:5,content:Rl(a,!1,bt(s,n)),loc:bt(e,t)})},onopentagname(e,t){const s=$t(e,t);Gt={type:1,tag:s,ns:Qe.getNamespace(s,dt[0],Qe.ns),tagType:0,props:[],children:[],loc:bt(e-1,t),codegenNode:void 0}},onopentagend(e){su(e)},onclosetag(e,t){const s=$t(e,t);if(!Qe.isVoidTag(s)){let n=!1;for(let a=0;a0&&ln(24,dt[0].loc.start.offset);for(let l=0;l<=a;l++){const r=dt.shift();Al(r,t,l(n.type===7?n.rawName:n.name)===s)&&ln(2,t)},onattribend(e,t){if(Gt&&Ge){if(Qn(Ge.loc,t),e!==0)if(cs.includes("&")&&(cs=Qe.decodeEntities(cs,!0)),Ge.type===6)Ge.name==="class"&&(cs=Oh(cs).trim()),e===1&&!cs&&ln(13,t),Ge.value={type:2,content:cs,loc:e===1?bt(cn,Wn):bt(cn-1,Wn+1)},gt.inSFCRoot&&Gt.tag==="template"&&Ge.name==="lang"&&cs&&cs!=="html"&>.enterRCDATA(er("a.content==="sync"))>-1&&Gi("COMPILER_V_BIND_SYNC",Qe,Ge.loc,Ge.arg.loc.source)&&(Ge.name="model",Ge.modifiers.splice(n,1))}(Ge.type!==7||Ge.name!=="pre")&&Gt.props.push(Ge)}cs="",cn=Wn=-1},oncomment(e,t){Qe.comments&&Po({type:3,content:$t(e,t),loc:bt(e-4,t+3)})},onend(){const e=_n.length;for(let t=0;t{const b=t.start.offset+p,y=b+u.length;return Rl(u,!1,bt(b,y),0,f?1:0)},r={source:l(i.trim(),s.indexOf(i,a.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let o=a.trim().replace(gx,"").trim();const c=a.indexOf(o),d=o.match(tu);if(d){o=o.replace(tu,"").trim();const u=d[1].trim();let p;if(u&&(p=s.indexOf(u,c+o.length),r.key=l(u,p,!0)),d[2]){const f=d[2].trim();f&&(r.index=l(f,s.indexOf(f,r.key?p+u.length:c+o.length),!0))}}return o&&(r.value=l(o,c,!0)),r}function $t(e,t){return _n.slice(e,t)}function su(e){gt.inSFCRoot&&(Gt.innerLoc=bt(e+1,e+1)),Po(Gt);const{tag:t,ns:s}=Gt;s===0&&Qe.isPreTag(t)&&Vc++,Qe.isVoidTag(t)?Al(Gt,e):(dt.unshift(Gt),(s===1||s===2)&&(gt.inXML=!0)),Gt=null}function yl(e,t,s){{const i=dt[0]&&dt[0].tag;i!=="script"&&i!=="style"&&e.includes("&")&&(e=Qe.decodeEntities(e,!1))}const n=dt[0]||Wi,a=n.children[n.children.length-1];a&&a.type===2?(a.content+=e,Qn(a.loc,s)):n.children.push({type:2,content:e,loc:bt(t,s)})}function Al(e,t,s=!1){s?Qn(e.loc,Rh(t,60)):Qn(e.loc,bx(t,62)+1),gt.inSFCRoot&&(e.children.length?e.innerLoc.end=ze({},e.children[e.children.length-1].loc.end):e.innerLoc.end=ze({},e.innerLoc.start),e.innerLoc.source=$t(e.innerLoc.start.offset,e.innerLoc.end.offset));const{tag:n,ns:a,children:i}=e;if(Pn||(n==="slot"?e.tagType=2:nu(e)?e.tagType=3:xx(e)&&(e.tagType=1)),gt.inRCDATA||(e.children=Ih(i)),a===0&&Qe.isIgnoreNewlineTag(n)){const l=i[0];l&&l.type===2&&(l.content=l.content.replace(/^\r?\n/,""))}a===0&&Qe.isPreTag(n)&&Vc--,Mo===e&&(Pn=gt.inVPre=!1,Mo=null),gt.inXML&&(dt[0]?dt[0].ns:Qe.ns)===0&&(gt.inXML=!1);{const l=e.props;if(!gt.inSFCRoot&&aa("COMPILER_NATIVE_TEMPLATE",Qe)&&e.tag==="template"&&!nu(e)){const o=dt[0]||Wi,c=o.children.indexOf(e);o.children.splice(c,1,...e.children)}const r=l.find(o=>o.type===6&&o.name==="inline-template");r&&Gi("COMPILER_INLINE_TEMPLATE",Qe,r.loc)&&e.children.length&&(r.value={type:2,content:$t(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:r.loc})}}function bx(e,t){let s=e;for(;_n.charCodeAt(s)!==t&&s<_n.length-1;)s++;return s}function Rh(e,t){let s=e;for(;_n.charCodeAt(s)!==t&&s>=0;)s--;return s}const yx=new Set(["if","else","else-if","for","slot"]);function nu({tag:e,props:t}){if(e==="template"){for(let s=0;s64&&e<91}const kx=/\r\n/g;function Ih(e){const t=Qe.whitespace!=="preserve";let s=!1;for(let n=0;ns.type!==3);return t.length===1&&t[0].type===1&&!sr(t[0])?t[0]:null}function Il(e,t,s,n=!1,a=!1){const{children:i}=e,l=[];for(let d=0;d0){if(p>=2){u.codegenNode.patchFlag=-1,l.push(u);continue}}else{const f=u.codegenNode;if(f.type===13){const b=f.patchFlag;if((b===void 0||b===512||b===1)&&Dh(u,s)>=2){const y=Mh(u);y&&(f.props=s.hoist(y))}f.dynamicProps&&(f.dynamicProps=s.hoist(f.dynamicProps))}}}else if(u.type===12&&(n?0:ys(u,s))>=2){u.codegenNode.type===14&&u.codegenNode.arguments.length>0&&u.codegenNode.arguments.push("-1"),l.push(u);continue}if(u.type===1){const p=u.tagType===1;p&&s.scopes.vSlot++,Il(u,e,s,!1,a),p&&s.scopes.vSlot--}else if(u.type===11)Il(u,e,s,u.children.length===1,!0);else if(u.type===9)for(let p=0;pf.key===u||f.key.content===u);return p&&p.value}}l.length&&s.transformHoist&&s.transformHoist(i,s,e)}function ys(e,t){const{constantCache:s}=t;switch(e.type){case 1:if(e.tagType!==0)return 0;const n=s.get(e);if(n!==void 0)return n;const a=e.codegenNode;if(a.type!==13||a.isBlock&&e.tag!=="svg"&&e.tag!=="foreignObject"&&e.tag!=="math")return 0;if(a.patchFlag===void 0){let l=3;const r=Dh(e,t);if(r===0)return s.set(e,0),0;r1)for(let o=0;oH&&(T.childIndex--,T.onNodeRemoved()),T.parent.children.splice(H,1)},onNodeRemoved:Ht,addIdentifiers(C){},removeIdentifiers(C){},hoist(C){Me(C)&&(C=$e(C)),T.hoists.push(C);const M=$e(`_hoisted_${T.hoists.length}`,!1,C.loc,2);return M.hoisted=C,M},cache(C,M=!1,H=!1){const P=tx(T.cached.length,C,M,H);return T.cached.push(P),P}};return T.filters=new Set,T}function Ox(e,t){const s=Ix(e,t);Ir(e,s),t.hoistStatic&&Ax(e,s),t.ssr||Nx(e,s),e.helpers=new Set([...s.helpers.keys()]),e.components=[...s.components],e.directives=[...s.directives],e.imports=s.imports,e.hoists=s.hoists,e.temps=s.temps,e.cached=s.cached,e.transformed=!0,e.filters=[...s.filters]}function Nx(e,t){const{helper:s}=t,{children:n}=e;if(n.length===1){const a=Nh(e);if(a&&a.codegenNode){const i=a.codegenNode;i.type===13&&Uc(i,t),e.codegenNode=i}else e.codegenNode=n[0]}else if(n.length>1){let a=64;e.codegenNode=qi(t,s(Vi),void 0,e.children,a,void 0,void 0,!0,void 0,!1)}}function Lx(e,t){let s=0;const n=()=>{s--};for(;sn===e:n=>e.test(n);return(n,a)=>{if(n.type===1){const{props:i}=n;if(n.tagType===3&&i.some(px))return;const l=[];for(let r=0;r`${Ka[e]}: _${Ka[e]}`;function Dx(e,{mode:t="function",prefixIdentifiers:s=t==="module",sourceMap:n=!1,filename:a="template.vue.html",scopeId:i=null,optimizeImports:l=!1,runtimeGlobalName:r="Vue",runtimeModuleName:o="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:d=!1,isTS:u=!1,inSSR:p=!1}){const f={mode:t,prefixIdentifiers:s,sourceMap:n,filename:a,scopeId:i,optimizeImports:l,runtimeGlobalName:r,runtimeModuleName:o,ssrRuntimeModuleName:c,ssr:d,isTS:u,inSSR:p,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(y){return`_${Ka[y]}`},push(y,E=-2,O){f.code+=y},indent(){b(++f.indentLevel)},deindent(y=!1){y?--f.indentLevel:b(--f.indentLevel)},newline(){b(f.indentLevel)}};function b(y){f.push(` +`+" ".repeat(y),0)}return f}function Mx(e,t={}){const s=Dx(e,t);t.onContextCreated&&t.onContextCreated(s);const{mode:n,push:a,prefixIdentifiers:i,indent:l,deindent:r,newline:o,scopeId:c,ssr:d}=s,u=Array.from(e.helpers),p=u.length>0,f=!i&&n!=="module";Px(e,s);const y=d?"ssrRender":"render",O=(d?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(a(`function ${y}(${O}) {`),l(),f&&(a("with (_ctx) {"),l(),p&&(a(`const { ${u.map(Fh).join(", ")} } = _Vue `,-1),o())),e.components.length&&(Qr(e.components,"component",s),(e.directives.length||e.temps>0)&&o()),e.directives.length&&(Qr(e.directives,"directive",s),e.temps>0&&o()),e.filters&&e.filters.length&&(o(),Qr(e.filters,"filter",s),o()),e.temps>0){a("let ");for(let x=0;x0?", ":""}_temp${x}`)}return(e.components.length||e.directives.length||e.temps)&&(a(` -`,0),o()),d||a("return "),e.codegenNode?Zt(e.codegenNode,s):a("null"),p&&(r(),a("}")),r(),a("}"),{ast:e,code:s.code,preamble:"",map:s.map?s.map.toJSON():void 0}}function Px(e,t){const{ssr:s,prefixIdentifiers:n,push:a,newline:i,runtimeModuleName:l,runtimeGlobalName:r,ssrRuntimeModuleName:o}=t,c=r,d=Array.from(e.helpers);if(d.length>0&&(a(`const _Vue = ${c} -`,-1),e.hoists.length)){const u=[Tc,Cc,nl,Ec,gh].filter(f=>d.includes(f)).map(Fh).join(", ");a(`const { ${u} } = _Vue -`,-1)}Fx(e.hoists,t),i(),a("return ")}function Qr(e,t,{helper:s,push:n,newline:a,isTS:i}){const l=s(t==="filter"?Oc:t==="component"?Ac:Ic);for(let r=0;r3||!1;t.push("["),s&&t.indent(),il(e,t,s),s&&t.deindent(),t.push("]")}function il(e,t,s=!1,n=!0){const{push:a,newline:i}=t;for(let l=0;ls||"null")}function jx(e,t){const{push:s,helper:n,pure:a}=t,i=Me(e.callee)?e.callee:n(e.callee);a&&s(Or),s(i+"(",-2,e),il(e.arguments,t),s(")")}function qx(e,t){const{push:s,indent:n,deindent:a,newline:i}=t,{properties:l}=e;if(!l.length){s("{}",-2,e);return}const r=l.length>1||!1;s(r?"{":"{ "),r&&n();for(let o=0;o "),(o||r)&&(s("{"),n()),l?(o&&s("return "),be(l)?jc(l,t):Zt(l,t)):r&&Zt(r,t),(o||r)&&(a(),s("}")),c&&(e.isNonScopedSlot&&s(", undefined, true"),s(")"))}function Wx(e,t){const{test:s,consequent:n,alternate:a,newline:i}=e,{push:l,indent:r,deindent:o,newline:c}=t;if(s.type===4){const u=!Hc(s.content);u&&l("("),$h(s,t),u&&l(")")}else l("("),Zt(s,t),l(")");i&&r(),t.indentLevel++,i||l(" "),l("? "),Zt(n,t),t.indentLevel--,i&&c(),i||l(" "),l(": ");const d=a.type===19;d||t.indentLevel++,Zt(a,t),d||t.indentLevel--,i&&o(!0)}function Zx(e,t){const{push:s,helper:n,indent:a,deindent:i,newline:l}=t,{needPauseTracking:r,needArraySpread:o}=e;o&&s("[...("),s(`_cache[${e.index}] || (`),r&&(a(),s(`${n(Xl)}(-1`),e.inVOnce&&s(", true"),s("),"),l(),s("(")),s(`_cache[${e.index}] = `),Zt(e.value,t),r&&(s(`).cacheIndex = ${e.index},`),l(),s(`${n(Xl)}(1),`),l(),s(`_cache[${e.index}]`),i()),s(")"),o&&s(")]")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const Jx=Ph(/^(?:if|else|else-if)$/,(e,t,s)=>Yx(e,t,s,(n,a,i)=>{const l=s.parent.children;let r=l.indexOf(n),o=0;for(;r-->=0;){const c=l[r];c&&c.type===9&&(o+=c.branches.length)}return()=>{if(i)n.codegenNode=iu(a,o,s);else{const c=Qx(n.codegenNode);c.alternate=iu(a,o+n.branches.length-1,s)}}}));function Yx(e,t,s,n){if(t.name!=="else"&&(!t.exp||!t.exp.content.trim())){const a=t.exp?t.exp.loc:e.loc;s.onError(ut(28,t.loc)),t.exp=Fe("true",!1,a)}if(t.name==="if"){const a=au(e,t),i={type:9,loc:Sx(e.loc),branches:[a]};if(s.replaceNode(i),n)return n(i,a,!0)}else{const a=s.parent.children;let i=a.indexOf(e);for(;i-->=-1;){const l=a[i];if(l&&Eh(l)){s.removeNode(l);continue}if(l&&l.type===9){(t.name==="else-if"||t.name==="else")&&l.branches[l.branches.length-1].condition===void 0&&s.onError(ut(30,e.loc)),s.removeNode();const r=au(e,t);l.branches.push(r);const o=n&&n(l,r,!1);Ir(r,s),o&&o(),s.currentNode=null}else s.onError(ut(30,e.loc));break}}}function au(e,t){const s=e.tagType===3;return{type:10,loc:e.loc,condition:t.name==="else"?void 0:t.exp,children:s&&!Rs(e,"for")?e.children:[e],userKey:Rr(e,"key"),isTemplateIf:s}}function iu(e,t,s){return e.condition?Do(e.condition,lu(e,t,s),It(s.helper(nl),['""',"true"])):lu(e,t,s)}function lu(e,t,s){const{helper:n}=s,a=wt("key",Fe(`${t}`,!1,ws,2)),{children:i}=e,l=i[0];if(i.length!==1||l.type!==1)if(i.length===1&&l.type===11){const o=l.codegenNode;return nr(o,a,s),o}else return qi(s,n(Vi),Is([a]),i,64,void 0,void 0,!0,!1,!1,e.loc);else{const o=l.codegenNode,c=hx(o);return c.type===13&&Bc(c,s),nr(c,a,s),o}}function Qx(e){for(;;)if(e.type===19)if(e.alternate.type===19)e=e.alternate;else return e;else e.type===20&&(e=e.value)}const Xx=Ph("for",(e,t,s)=>{const{helper:n,removeHelper:a}=s;return e0(e,t,s,i=>{const l=It(n(Lc),[i.source]),r=tr(e),o=Rs(e,"memo"),c=Rr(e,"key",!1,!0);c&&c.type;let d=c&&(c.type===6?c.value?Fe(c.value.content,!0):void 0:c.exp);const u=d?wt("key",d):null,f=i.source.type===4&&i.source.constType>0,p=f?64:c?128:256;return i.codegenNode=qi(s,n(Vi),void 0,l,p,void 0,void 0,!0,!f,!1,e.loc),()=>{let b;const{children:y}=i,E=y.length!==1||y[0].type!==1,I=sr(e)?e:r&&e.children.length===1&&sr(e.children[0])?e.children[0]:null;if(I?(b=I.codegenNode,r&&u&&nr(b,u,s)):E?b=qi(s,n(Vi),u?Is([u]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(b=y[0].codegenNode,r&&u&&nr(b,u,s),b.isBlock!==!f&&(b.isBlock?(a(ra),a(Ja(s.inSSR,b.isComponent))):a(Za(s.inSSR,b.isComponent))),b.isBlock=!f,b.isBlock?(n(ra),n(Ja(s.inSSR,b.isComponent))):n(Za(s.inSSR,b.isComponent))),o){const x=Wa(Fo(i.parseResult,[Fe("_cached")]));x.body=sx([Vs(["const _memo = (",o.exp,")"]),Vs(["if (_cached && _cached.el",...d?[" && _cached.key === ",d]:[],` && ${s.helperString(yh)}(_cached, _memo)) return _cached`]),Vs(["const _item = ",b]),Fe("_item.memo = _memo"),Fe("return _item")]),l.arguments.push(x,Fe("_cache"),Fe(String(s.cached.length))),s.cached.push(null)}else l.arguments.push(Wa(Fo(i.parseResult),b,!0))}})});function e0(e,t,s,n){if(!t.exp){s.onError(ut(31,t.loc));return}const a=t.forParseResult;if(!a){s.onError(ut(32,t.loc));return}Uh(a);const{addIdentifiers:i,removeIdentifiers:l,scopes:r}=s,{source:o,value:c,key:d,index:u}=a,f={type:11,loc:t.loc,source:o,valueAlias:c,keyAlias:d,objectIndexAlias:u,parseResult:a,children:tr(e)?e.children:[e]};s.replaceNode(f),r.vFor++;const p=n&&n(f);return()=>{r.vFor--,p&&p()}}function Uh(e,t){e.finalized||(e.finalized=!0)}function Fo({value:e,key:t,index:s},n=[]){return t0([e,t,s,...n])}function t0(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((s,n)=>s||Fe("_".repeat(n+1),!1))}const ru=Fe("undefined",!1),s0=(e,t)=>{if(e.type===1&&(e.tagType===1||e.tagType===3)){const s=Rs(e,"slot");if(s)return s.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},n0=(e,t,s,n)=>Wa(e,s,!1,!0,s.length?s[0].loc:n);function a0(e,t,s=n0){t.helper(Fc);const{children:n,loc:a}=e,i=[],l=[];let r=t.scopes.vSlot>0||t.scopes.vFor>0;const o=Rs(e,"slot",!0);if(o){const{arg:E,exp:I}=o;E&&!hs(E)&&(r=!0),i.push(wt(E||Fe("default",!0),s(I,void 0,n,a)))}let c=!1,d=!1;const u=[],f=new Set;let p=0;for(let E=0;E{const m=s(I,void 0,x,a);return t.compatConfig&&(m.isNonScopedSlot=!0),wt("default",m)};c?u.length&&!u.every(zc)&&(d?t.onError(ut(39,u[0].loc)):i.push(E(void 0,u))):i.push(E(void 0,n))}const b=r?2:Ol(e.children)?3:1;let y=Is(i.concat(wt("_",Fe(b+"",!1))),a);return l.length&&(y=It(t.helper(bh),[y,na(l)])),{slots:y,hasDynamicSlots:r}}function xl(e,t,s){const n=[wt("name",e),wt("fn",t)];return s!=null&&n.push(wt("key",Fe(String(s),!0))),Is(n)}function Ol(e){for(let t=0;tfunction(){if(e=t.currentNode,!(e.type===1&&(e.tagType===0||e.tagType===1)))return;const{tag:n,props:a}=e,i=e.tagType===1;let l=i?l0(e,t):`"${n}"`;const r=Xe(l)&&l.callee===Rc;let o,c,d=0,u,f,p,b=r||l===Ei||l===Sc||!i&&(n==="svg"||n==="foreignObject"||n==="math");if(a.length>0){const y=zh(e,t,void 0,i,r);o=y.props,d=y.patchFlag,f=y.dynamicPropNames;const E=y.directives;p=E&&E.length?na(E.map(I=>o0(I,t))):void 0,y.shouldUseBlock&&(b=!0)}if(e.children.length>0)if(l===Yl&&(b=!0,d|=1024),i&&l!==Ei&&l!==Yl){const{slots:E,hasDynamicSlots:I}=a0(e,t);c=E,I&&(d|=1024)}else if(e.children.length===1&&l!==Ei){const E=e.children[0],I=E.type,x=I===5||I===8;x&&ys(E,t)===0&&(d|=1),x||I===2?c=E:c=e.children}else c=e.children;f&&f.length&&(u=c0(f)),e.codegenNode=qi(t,l,o,c,d===0?void 0:d,u,p,!!b,!1,i,e.loc)};function l0(e,t,s=!1){let{tag:n}=e;const a=$o(n),i=Rr(e,"is",!1,!0);if(i)if(a||aa("COMPILER_IS_ON_ELEMENT",t)){let r;if(i.type===6?r=i.value&&Fe(i.value.content,!0):(r=i.exp,r||(r=Fe("is",!1,i.arg.loc))),r)return It(t.helper(Rc),[r])}else i.type===6&&i.value.content.startsWith("vue:")&&(n=i.value.content.slice(4));const l=_h(n)||t.isBuiltInComponent(n);return l?(s||t.helper(l),l):(t.helper(Ac),t.components.add(n),Ki(n,"component"))}function zh(e,t,s=e.props,n,a,i=!1){const{tag:l,loc:r,children:o}=e;let c=[];const d=[],u=[],f=o.length>0;let p=!1,b=0,y=!1,E=!1,I=!1,x=!1,m=!1,_=!1;const S=[],g=M=>{c.length&&(d.push(Is(ou(c),r)),c=[]),M&&d.push(M)},w=()=>{t.scopes.vFor>0&&c.push(wt(Fe("ref_for",!0),Fe("true")))},T=({key:M,value:H})=>{if(hs(M)){const P=M.content,R=ca(P);if(R&&(!n||a)&&P.toLowerCase()!=="onclick"&&P!=="onUpdate:modelValue"&&!bn(P)&&(x=!0),R&&bn(P)&&(_=!0),R&&H.type===14&&(H=H.arguments[0]),H.type===20||(H.type===4||H.type===8)&&ys(H,t)>0)return;P==="ref"?y=!0:P==="class"?E=!0:P==="style"?I=!0:P!=="key"&&!S.includes(P)&&S.push(P),n&&(P==="class"||P==="style")&&!S.includes(P)&&S.push(P)}else m=!0};for(let M=0;Mwe.content==="prop")&&(b|=32);const Y=t.directiveTransforms[P];if(Y){const{props:we,needRuntime:ke}=Y(H,e,t);!i&&we.forEach(T),N&&R&&!hs(R)?g(Is(we,r)):c.push(...we),ke&&(u.push(H),Jt(ke)&&Hh.set(H,ke))}else Xm(P)||(u.push(H),f&&(p=!0))}}let C;if(d.length?(g(),d.length>1?C=It(t.helper(Ql),d,r):C=d[0]):c.length&&(C=Is(ou(c),r)),m?b|=16:(E&&!n&&(b|=2),I&&!n&&(b|=4),S.length&&(b|=8),x&&(b|=32)),!p&&(b===0||b===32)&&(y||_||u.length>0)&&(b|=512),!t.inSSR&&C)switch(C.type){case 15:let M=-1,H=-1,P=!1;for(let Q=0;Qwt(l,i)),a))}return na(s,e.loc)}function c0(e){let t="[";for(let s=0,n=e.length;s{if(sr(e)){const{children:s,loc:n}=e,{slotName:a,slotProps:i}=u0(e,t),l=[t.prefixIdentifiers?"_ctx.$slots":"$slots",a,"{}","undefined","true"];let r=2;i&&(l[2]=i,r=3),s.length&&(l[3]=Wa([],s,!1,!1,n),r=4),t.scopeId&&!t.slotted&&(r=5),l.splice(r),e.codegenNode=It(t.helper(vh),l,n)}};function u0(e,t){let s='"default"',n;const a=[];for(let i=0;i0){const{props:i,directives:l}=zh(e,t,a,!1,!1);n=i,l.length&&t.onError(ut(36,l[0].loc))}return{slotName:s,slotProps:n}}const Vh=(e,t,s,n)=>{const{loc:a,modifiers:i,arg:l}=e;!e.exp&&!i.length&&s.onError(ut(35,a));let r;if(l.type===4)if(l.isStatic){let u=l.content;u.startsWith("vue:")&&(u=`vnode-${u.slice(4)}`);const f=t.tagType!==0||u.startsWith("vnode")||!/[A-Z]/.test(u)?Da(it(u)):`on:${u}`;r=Fe(f,!0,l.loc)}else r=Vs([`${s.helperString(Lo)}(`,l,")"]);else r=l,r.children.unshift(`${s.helperString(Lo)}(`),r.children.push(")");let o=e.exp;o&&!o.content.trim()&&(o=void 0);let c=s.cacheHandlers&&!o&&!s.inVOnce;if(o){const u=Sh(o),f=!(u||dx(o)),p=o.content.includes(";");(f||c&&u)&&(o=Vs([`${f?"$event":"(...args)"} => ${p?"{":"("}`,o,p?"}":")"]))}let d={props:[wt(r,o||Fe("() => {}",!1,a))]};return n&&(d=n(d)),c&&(d.props[0].value=s.cache(d.props[0].value)),d.props.forEach(u=>u.key.isHandlerKey=!0),d},f0=(e,t,s)=>{const{modifiers:n,loc:a}=e,i=e.arg;let{exp:l}=e;return l&&l.type===4&&!l.content.trim()&&(l=void 0),i.type!==4?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=i.content?`${i.content} || ""`:'""'),n.some(r=>r.content==="camel")&&(i.type===4?i.isStatic?i.content=it(i.content):i.content=`${s.helperString(No)}(${i.content})`:(i.children.unshift(`${s.helperString(No)}(`),i.children.push(")"))),s.inSSR||(n.some(r=>r.content==="prop")&&cu(i,"."),n.some(r=>r.content==="attr")&&cu(i,"^")),{props:[wt(i,l)]}},cu=(e,t)=>{e.type===4?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},p0=(e,t)=>{if(e.type===0||e.type===1||e.type===11||e.type===10)return()=>{const s=e.children;let n,a=!1;for(let i=0;ii.type===7&&!t.directiveTransforms[i.name])&&e.tag!=="template")))for(let i=0;i{if(e.type===1&&Rs(e,"once",!0))return du.has(e)||t.inVOnce||t.inSSR?void 0:(du.add(e),t.inVOnce=!0,t.helper(Xl),()=>{t.inVOnce=!1;const s=t.currentNode;s.codegenNode&&(s.codegenNode=t.cache(s.codegenNode,!0,!0))})},jh=(e,t,s)=>{const{exp:n,arg:a}=e;if(!n)return s.onError(ut(41,e.loc)),ui();const i=n.loc.source.trim(),l=n.type===4?n.content:i,r=s.bindingMetadata[i];if(r==="props"||r==="props-aliased")return s.onError(ut(44,n.loc)),ui();if(r==="literal-const"||r==="setup-const")return s.onError(ut(45,n.loc)),ui();if(!l.trim()||!Sh(n))return s.onError(ut(42,n.loc)),ui();const o=a||Fe("modelValue",!0),c=a?hs(a)?`onUpdate:${it(a.content)}`:Vs(['"onUpdate:" + ',a]):"onUpdate:modelValue";let d;const u=s.isTS?"($event: any)":"$event";d=Vs([`${u} => ((`,n,") = $event)"]);const f=[wt(o,e.exp),wt(c,d)];if(e.modifiers.length&&t.tagType===1){const p=e.modifiers.map(y=>y.content).map(y=>(Hc(y)?y:JSON.stringify(y))+": true").join(", "),b=a?hs(a)?`${a.content}Modifiers`:Vs([a,' + "Modifiers"']):"modelModifiers";f.push(wt(b,Fe(`{ ${p} }`,!1,e.loc,2)))}return ui(f)};function ui(e=[]){return{props:e}}const m0=/[\w).+\-_$\]]/,g0=(e,t)=>{aa("COMPILER_FILTERS",t)&&(e.type===5?ar(e.content,t):e.type===1&&e.props.forEach(s=>{s.type===7&&s.name!=="for"&&s.exp&&ar(s.exp,t)}))};function ar(e,t){if(e.type===4)uu(e,t);else for(let s=0;s=0&&(x=s.charAt(I),x===" ");I--);(!x||!m0.test(x))&&(l=!0)}}b===void 0?b=s.slice(0,p).trim():d!==0&&E();function E(){y.push(s.slice(d,p).trim()),d=p+1}if(y.length){for(p=0;p{if(e.type===1){const s=Rs(e,"memo");return!s||fu.has(e)||t.inSSR?void 0:(fu.add(e),()=>{const n=e.codegenNode||t.currentNode.codegenNode;n&&n.type===13&&(e.tagType!==1&&Bc(n,t),e.codegenNode=It(t.helper($c),[s.exp,Wa(void 0,n),"_cache",String(t.cached.length)]),t.cached.push(null))})}},y0=(e,t)=>{if(e.type===1){for(const s of e.props)if(s.type===7&&s.name==="bind"&&(!s.exp||s.exp.type===4&&!s.exp.content.trim())&&s.arg){const n=s.arg;if(n.type!==4||!n.isStatic)t.onError(ut(53,n.loc)),s.exp=Fe("",!0,n.loc);else{const a=it(n.content);(kh.test(a[0])||a[0]==="-")&&(s.exp=Fe(a,!1,n.loc))}}}};function x0(e){return[[y0,h0,Jx,b0,Xx,g0,d0,i0,s0,p0],{on:Vh,bind:f0,model:jh}]}function _0(e,t={}){const s=t.onError||Uc,n=t.mode==="module";t.prefixIdentifiers===!0?s(ut(48)):n&&s(ut(49));const a=!1;t.cacheHandlers&&s(ut(50)),t.scopeId&&!n&&s(ut(51));const i=ze({},t,{prefixIdentifiers:a}),l=Me(e)?Ex(e,i):e,[r,o]=x0();return Ox(l,ze({},i,{nodeTransforms:[...r,...t.nodeTransforms||[]],directiveTransforms:ze({},o,t.directiveTransforms||{})})),Mx(l,i)}const k0=()=>({props:[]});/** +`,0),o()),d||a("return "),e.codegenNode?Zt(e.codegenNode,s):a("null"),f&&(r(),a("}")),r(),a("}"),{ast:e,code:s.code,preamble:"",map:s.map?s.map.toJSON():void 0}}function Px(e,t){const{ssr:s,prefixIdentifiers:n,push:a,newline:i,runtimeModuleName:l,runtimeGlobalName:r,ssrRuntimeModuleName:o}=t,c=r,d=Array.from(e.helpers);if(d.length>0&&(a(`const _Vue = ${c} +`,-1),e.hoists.length)){const u=[Tc,Cc,nl,Ec,gh].filter(p=>d.includes(p)).map(Fh).join(", ");a(`const { ${u} } = _Vue +`,-1)}Fx(e.hoists,t),i(),a("return ")}function Qr(e,t,{helper:s,push:n,newline:a,isTS:i}){const l=s(t==="filter"?Oc:t==="component"?Ac:Ic);for(let r=0;r3||!1;t.push("["),s&&t.indent(),il(e,t,s),s&&t.deindent(),t.push("]")}function il(e,t,s=!1,n=!0){const{push:a,newline:i}=t;for(let l=0;ls||"null")}function jx(e,t){const{push:s,helper:n,pure:a}=t,i=Me(e.callee)?e.callee:n(e.callee);a&&s(Or),s(i+"(",-2,e),il(e.arguments,t),s(")")}function qx(e,t){const{push:s,indent:n,deindent:a,newline:i}=t,{properties:l}=e;if(!l.length){s("{}",-2,e);return}const r=l.length>1||!1;s(r?"{":"{ "),r&&n();for(let o=0;o "),(o||r)&&(s("{"),n()),l?(o&&s("return "),ye(l)?jc(l,t):Zt(l,t)):r&&Zt(r,t),(o||r)&&(a(),s("}")),c&&(e.isNonScopedSlot&&s(", undefined, true"),s(")"))}function Wx(e,t){const{test:s,consequent:n,alternate:a,newline:i}=e,{push:l,indent:r,deindent:o,newline:c}=t;if(s.type===4){const u=!Hc(s.content);u&&l("("),$h(s,t),u&&l(")")}else l("("),Zt(s,t),l(")");i&&r(),t.indentLevel++,i||l(" "),l("? "),Zt(n,t),t.indentLevel--,i&&c(),i||l(" "),l(": ");const d=a.type===19;d||t.indentLevel++,Zt(a,t),d||t.indentLevel--,i&&o(!0)}function Zx(e,t){const{push:s,helper:n,indent:a,deindent:i,newline:l}=t,{needPauseTracking:r,needArraySpread:o}=e;o&&s("[...("),s(`_cache[${e.index}] || (`),r&&(a(),s(`${n(Xl)}(-1`),e.inVOnce&&s(", true"),s("),"),l(),s("(")),s(`_cache[${e.index}] = `),Zt(e.value,t),r&&(s(`).cacheIndex = ${e.index},`),l(),s(`${n(Xl)}(1),`),l(),s(`_cache[${e.index}]`),i()),s(")"),o&&s(")]")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const Jx=Ph(/^(?:if|else|else-if)$/,(e,t,s)=>Yx(e,t,s,(n,a,i)=>{const l=s.parent.children;let r=l.indexOf(n),o=0;for(;r-->=0;){const c=l[r];c&&c.type===9&&(o+=c.branches.length)}return()=>{if(i)n.codegenNode=iu(a,o,s);else{const c=Qx(n.codegenNode);c.alternate=iu(a,o+n.branches.length-1,s)}}}));function Yx(e,t,s,n){if(t.name!=="else"&&(!t.exp||!t.exp.content.trim())){const a=t.exp?t.exp.loc:e.loc;s.onError(ut(28,t.loc)),t.exp=$e("true",!1,a)}if(t.name==="if"){const a=au(e,t),i={type:9,loc:Sx(e.loc),branches:[a]};if(s.replaceNode(i),n)return n(i,a,!0)}else{const a=s.parent.children;let i=a.indexOf(e);for(;i-->=-1;){const l=a[i];if(l&&Eh(l)){s.removeNode(l);continue}if(l&&l.type===9){(t.name==="else-if"||t.name==="else")&&l.branches[l.branches.length-1].condition===void 0&&s.onError(ut(30,e.loc)),s.removeNode();const r=au(e,t);l.branches.push(r);const o=n&&n(l,r,!1);Ir(r,s),o&&o(),s.currentNode=null}else s.onError(ut(30,e.loc));break}}}function au(e,t){const s=e.tagType===3;return{type:10,loc:e.loc,condition:t.name==="else"?void 0:t.exp,children:s&&!Rs(e,"for")?e.children:[e],userKey:Rr(e,"key"),isTemplateIf:s}}function iu(e,t,s){return e.condition?Do(e.condition,lu(e,t,s),It(s.helper(nl),['""',"true"])):lu(e,t,s)}function lu(e,t,s){const{helper:n}=s,a=wt("key",$e(`${t}`,!1,ws,2)),{children:i}=e,l=i[0];if(i.length!==1||l.type!==1)if(i.length===1&&l.type===11){const o=l.codegenNode;return nr(o,a,s),o}else return qi(s,n(Vi),Is([a]),i,64,void 0,void 0,!0,!1,!1,e.loc);else{const o=l.codegenNode,c=hx(o);return c.type===13&&Uc(c,s),nr(c,a,s),o}}function Qx(e){for(;;)if(e.type===19)if(e.alternate.type===19)e=e.alternate;else return e;else e.type===20&&(e=e.value)}const Xx=Ph("for",(e,t,s)=>{const{helper:n,removeHelper:a}=s;return e0(e,t,s,i=>{const l=It(n(Lc),[i.source]),r=tr(e),o=Rs(e,"memo"),c=Rr(e,"key",!1,!0);c&&c.type;let d=c&&(c.type===6?c.value?$e(c.value.content,!0):void 0:c.exp);const u=d?wt("key",d):null,p=i.source.type===4&&i.source.constType>0,f=p?64:c?128:256;return i.codegenNode=qi(s,n(Vi),void 0,l,f,void 0,void 0,!0,!p,!1,e.loc),()=>{let b;const{children:y}=i,E=y.length!==1||y[0].type!==1,O=sr(e)?e:r&&e.children.length===1&&sr(e.children[0])?e.children[0]:null;if(O?(b=O.codegenNode,r&&u&&nr(b,u,s)):E?b=qi(s,n(Vi),u?Is([u]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(b=y[0].codegenNode,r&&u&&nr(b,u,s),b.isBlock!==!p&&(b.isBlock?(a(ra),a(Ja(s.inSSR,b.isComponent))):a(Za(s.inSSR,b.isComponent))),b.isBlock=!p,b.isBlock?(n(ra),n(Ja(s.inSSR,b.isComponent))):n(Za(s.inSSR,b.isComponent))),o){const x=Wa(Fo(i.parseResult,[$e("_cached")]));x.body=sx([Vs(["const _memo = (",o.exp,")"]),Vs(["if (_cached && _cached.el",...d?[" && _cached.key === ",d]:[],` && ${s.helperString(yh)}(_cached, _memo)) return _cached`]),Vs(["const _item = ",b]),$e("_item.memo = _memo"),$e("return _item")]),l.arguments.push(x,$e("_cache"),$e(String(s.cached.length))),s.cached.push(null)}else l.arguments.push(Wa(Fo(i.parseResult),b,!0))}})});function e0(e,t,s,n){if(!t.exp){s.onError(ut(31,t.loc));return}const a=t.forParseResult;if(!a){s.onError(ut(32,t.loc));return}Bh(a);const{addIdentifiers:i,removeIdentifiers:l,scopes:r}=s,{source:o,value:c,key:d,index:u}=a,p={type:11,loc:t.loc,source:o,valueAlias:c,keyAlias:d,objectIndexAlias:u,parseResult:a,children:tr(e)?e.children:[e]};s.replaceNode(p),r.vFor++;const f=n&&n(p);return()=>{r.vFor--,f&&f()}}function Bh(e,t){e.finalized||(e.finalized=!0)}function Fo({value:e,key:t,index:s},n=[]){return t0([e,t,s,...n])}function t0(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((s,n)=>s||$e("_".repeat(n+1),!1))}const ru=$e("undefined",!1),s0=(e,t)=>{if(e.type===1&&(e.tagType===1||e.tagType===3)){const s=Rs(e,"slot");if(s)return s.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},n0=(e,t,s,n)=>Wa(e,s,!1,!0,s.length?s[0].loc:n);function a0(e,t,s=n0){t.helper(Fc);const{children:n,loc:a}=e,i=[],l=[];let r=t.scopes.vSlot>0||t.scopes.vFor>0;const o=Rs(e,"slot",!0);if(o){const{arg:E,exp:O}=o;E&&!hs(E)&&(r=!0),i.push(wt(E||$e("default",!0),s(O,void 0,n,a)))}let c=!1,d=!1;const u=[],p=new Set;let f=0;for(let E=0;E{const m=s(O,void 0,x,a);return t.compatConfig&&(m.isNonScopedSlot=!0),wt("default",m)};c?u.length&&!u.every(zc)&&(d?t.onError(ut(39,u[0].loc)):i.push(E(void 0,u))):i.push(E(void 0,n))}const b=r?2:Ol(e.children)?3:1;let y=Is(i.concat(wt("_",$e(b+"",!1))),a);return l.length&&(y=It(t.helper(bh),[y,na(l)])),{slots:y,hasDynamicSlots:r}}function xl(e,t,s){const n=[wt("name",e),wt("fn",t)];return s!=null&&n.push(wt("key",$e(String(s),!0))),Is(n)}function Ol(e){for(let t=0;tfunction(){if(e=t.currentNode,!(e.type===1&&(e.tagType===0||e.tagType===1)))return;const{tag:n,props:a}=e,i=e.tagType===1;let l=i?l0(e,t):`"${n}"`;const r=Xe(l)&&l.callee===Rc;let o,c,d=0,u,p,f,b=r||l===Ei||l===Sc||!i&&(n==="svg"||n==="foreignObject"||n==="math");if(a.length>0){const y=zh(e,t,void 0,i,r);o=y.props,d=y.patchFlag,p=y.dynamicPropNames;const E=y.directives;f=E&&E.length?na(E.map(O=>o0(O,t))):void 0,y.shouldUseBlock&&(b=!0)}if(e.children.length>0)if(l===Yl&&(b=!0,d|=1024),i&&l!==Ei&&l!==Yl){const{slots:E,hasDynamicSlots:O}=a0(e,t);c=E,O&&(d|=1024)}else if(e.children.length===1&&l!==Ei){const E=e.children[0],O=E.type,x=O===5||O===8;x&&ys(E,t)===0&&(d|=1),x||O===2?c=E:c=e.children}else c=e.children;p&&p.length&&(u=c0(p)),e.codegenNode=qi(t,l,o,c,d===0?void 0:d,u,f,!!b,!1,i,e.loc)};function l0(e,t,s=!1){let{tag:n}=e;const a=$o(n),i=Rr(e,"is",!1,!0);if(i)if(a||aa("COMPILER_IS_ON_ELEMENT",t)){let r;if(i.type===6?r=i.value&&$e(i.value.content,!0):(r=i.exp,r||(r=$e("is",!1,i.arg.loc))),r)return It(t.helper(Rc),[r])}else i.type===6&&i.value.content.startsWith("vue:")&&(n=i.value.content.slice(4));const l=_h(n)||t.isBuiltInComponent(n);return l?(s||t.helper(l),l):(t.helper(Ac),t.components.add(n),Ki(n,"component"))}function zh(e,t,s=e.props,n,a,i=!1){const{tag:l,loc:r,children:o}=e;let c=[];const d=[],u=[],p=o.length>0;let f=!1,b=0,y=!1,E=!1,O=!1,x=!1,m=!1,_=!1;const S=[],g=M=>{c.length&&(d.push(Is(ou(c),r)),c=[]),M&&d.push(M)},w=()=>{t.scopes.vFor>0&&c.push(wt($e("ref_for",!0),$e("true")))},T=({key:M,value:H})=>{if(hs(M)){const P=M.content,R=ca(P);if(R&&(!n||a)&&P.toLowerCase()!=="onclick"&&P!=="onUpdate:modelValue"&&!bn(P)&&(x=!0),R&&bn(P)&&(_=!0),R&&H.type===14&&(H=H.arguments[0]),H.type===20||(H.type===4||H.type===8)&&ys(H,t)>0)return;P==="ref"?y=!0:P==="class"?E=!0:P==="style"?O=!0:P!=="key"&&!S.includes(P)&&S.push(P),n&&(P==="class"||P==="style")&&!S.includes(P)&&S.push(P)}else m=!0};for(let M=0;MSe.content==="prop")&&(b|=32);const Y=t.directiveTransforms[P];if(Y){const{props:Se,needRuntime:we}=Y(H,e,t);!i&&Se.forEach(T),I&&R&&!hs(R)?g(Is(Se,r)):c.push(...Se),we&&(u.push(H),Jt(we)&&Hh.set(H,we))}else Xm(P)||(u.push(H),p&&(f=!0))}}let C;if(d.length?(g(),d.length>1?C=It(t.helper(Ql),d,r):C=d[0]):c.length&&(C=Is(ou(c),r)),m?b|=16:(E&&!n&&(b|=2),O&&!n&&(b|=4),S.length&&(b|=8),x&&(b|=32)),!f&&(b===0||b===32)&&(y||_||u.length>0)&&(b|=512),!t.inSSR&&C)switch(C.type){case 15:let M=-1,H=-1,P=!1;for(let Q=0;Qwt(l,i)),a))}return na(s,e.loc)}function c0(e){let t="[";for(let s=0,n=e.length;s{if(sr(e)){const{children:s,loc:n}=e,{slotName:a,slotProps:i}=u0(e,t),l=[t.prefixIdentifiers?"_ctx.$slots":"$slots",a,"{}","undefined","true"];let r=2;i&&(l[2]=i,r=3),s.length&&(l[3]=Wa([],s,!1,!1,n),r=4),t.scopeId&&!t.slotted&&(r=5),l.splice(r),e.codegenNode=It(t.helper(vh),l,n)}};function u0(e,t){let s='"default"',n;const a=[];for(let i=0;i0){const{props:i,directives:l}=zh(e,t,a,!1,!1);n=i,l.length&&t.onError(ut(36,l[0].loc))}return{slotName:s,slotProps:n}}const Vh=(e,t,s,n)=>{const{loc:a,modifiers:i,arg:l}=e;!e.exp&&!i.length&&s.onError(ut(35,a));let r;if(l.type===4)if(l.isStatic){let u=l.content;u.startsWith("vue:")&&(u=`vnode-${u.slice(4)}`);const p=t.tagType!==0||u.startsWith("vnode")||!/[A-Z]/.test(u)?Da(it(u)):`on:${u}`;r=$e(p,!0,l.loc)}else r=Vs([`${s.helperString(Lo)}(`,l,")"]);else r=l,r.children.unshift(`${s.helperString(Lo)}(`),r.children.push(")");let o=e.exp;o&&!o.content.trim()&&(o=void 0);let c=s.cacheHandlers&&!o&&!s.inVOnce;if(o){const u=Sh(o),p=!(u||dx(o)),f=o.content.includes(";");(p||c&&u)&&(o=Vs([`${p?"$event":"(...args)"} => ${f?"{":"("}`,o,f?"}":")"]))}let d={props:[wt(r,o||$e("() => {}",!1,a))]};return n&&(d=n(d)),c&&(d.props[0].value=s.cache(d.props[0].value)),d.props.forEach(u=>u.key.isHandlerKey=!0),d},p0=(e,t,s)=>{const{modifiers:n,loc:a}=e,i=e.arg;let{exp:l}=e;return l&&l.type===4&&!l.content.trim()&&(l=void 0),i.type!==4?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=i.content?`${i.content} || ""`:'""'),n.some(r=>r.content==="camel")&&(i.type===4?i.isStatic?i.content=it(i.content):i.content=`${s.helperString(No)}(${i.content})`:(i.children.unshift(`${s.helperString(No)}(`),i.children.push(")"))),s.inSSR||(n.some(r=>r.content==="prop")&&cu(i,"."),n.some(r=>r.content==="attr")&&cu(i,"^")),{props:[wt(i,l)]}},cu=(e,t)=>{e.type===4?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},f0=(e,t)=>{if(e.type===0||e.type===1||e.type===11||e.type===10)return()=>{const s=e.children;let n,a=!1;for(let i=0;ii.type===7&&!t.directiveTransforms[i.name])&&e.tag!=="template")))for(let i=0;i{if(e.type===1&&Rs(e,"once",!0))return du.has(e)||t.inVOnce||t.inSSR?void 0:(du.add(e),t.inVOnce=!0,t.helper(Xl),()=>{t.inVOnce=!1;const s=t.currentNode;s.codegenNode&&(s.codegenNode=t.cache(s.codegenNode,!0,!0))})},jh=(e,t,s)=>{const{exp:n,arg:a}=e;if(!n)return s.onError(ut(41,e.loc)),ui();const i=n.loc.source.trim(),l=n.type===4?n.content:i,r=s.bindingMetadata[i];if(r==="props"||r==="props-aliased")return s.onError(ut(44,n.loc)),ui();if(r==="literal-const"||r==="setup-const")return s.onError(ut(45,n.loc)),ui();if(!l.trim()||!Sh(n))return s.onError(ut(42,n.loc)),ui();const o=a||$e("modelValue",!0),c=a?hs(a)?`onUpdate:${it(a.content)}`:Vs(['"onUpdate:" + ',a]):"onUpdate:modelValue";let d;const u=s.isTS?"($event: any)":"$event";d=Vs([`${u} => ((`,n,") = $event)"]);const p=[wt(o,e.exp),wt(c,d)];if(e.modifiers.length&&t.tagType===1){const f=e.modifiers.map(y=>y.content).map(y=>(Hc(y)?y:JSON.stringify(y))+": true").join(", "),b=a?hs(a)?`${a.content}Modifiers`:Vs([a,' + "Modifiers"']):"modelModifiers";p.push(wt(b,$e(`{ ${f} }`,!1,e.loc,2)))}return ui(p)};function ui(e=[]){return{props:e}}const m0=/[\w).+\-_$\]]/,g0=(e,t)=>{aa("COMPILER_FILTERS",t)&&(e.type===5?ar(e.content,t):e.type===1&&e.props.forEach(s=>{s.type===7&&s.name!=="for"&&s.exp&&ar(s.exp,t)}))};function ar(e,t){if(e.type===4)uu(e,t);else for(let s=0;s=0&&(x=s.charAt(O),x===" ");O--);(!x||!m0.test(x))&&(l=!0)}}b===void 0?b=s.slice(0,f).trim():d!==0&&E();function E(){y.push(s.slice(d,f).trim()),d=f+1}if(y.length){for(f=0;f{if(e.type===1){const s=Rs(e,"memo");return!s||pu.has(e)||t.inSSR?void 0:(pu.add(e),()=>{const n=e.codegenNode||t.currentNode.codegenNode;n&&n.type===13&&(e.tagType!==1&&Uc(n,t),e.codegenNode=It(t.helper($c),[s.exp,Wa(void 0,n),"_cache",String(t.cached.length)]),t.cached.push(null))})}},y0=(e,t)=>{if(e.type===1){for(const s of e.props)if(s.type===7&&s.name==="bind"&&(!s.exp||s.exp.type===4&&!s.exp.content.trim())&&s.arg){const n=s.arg;if(n.type!==4||!n.isStatic)t.onError(ut(53,n.loc)),s.exp=$e("",!0,n.loc);else{const a=it(n.content);(kh.test(a[0])||a[0]==="-")&&(s.exp=$e(a,!1,n.loc))}}}};function x0(e){return[[y0,h0,Jx,b0,Xx,g0,d0,i0,s0,f0],{on:Vh,bind:p0,model:jh}]}function _0(e,t={}){const s=t.onError||Bc,n=t.mode==="module";t.prefixIdentifiers===!0?s(ut(48)):n&&s(ut(49));const a=!1;t.cacheHandlers&&s(ut(50)),t.scopeId&&!n&&s(ut(51));const i=ze({},t,{prefixIdentifiers:a}),l=Me(e)?Ex(e,i):e,[r,o]=x0();return Ox(l,ze({},i,{nodeTransforms:[...r,...t.nodeTransforms||[]],directiveTransforms:ze({},o,t.directiveTransforms||{})})),Mx(l,i)}const k0=()=>({props:[]});/** * @vue/compiler-dom v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const qh=Symbol(""),Gh=Symbol(""),Kh=Symbol(""),Wh=Symbol(""),Bo=Symbol(""),Zh=Symbol(""),Jh=Symbol(""),Yh=Symbol(""),Qh=Symbol(""),Xh=Symbol("");Xy({[qh]:"vModelRadio",[Gh]:"vModelCheckbox",[Kh]:"vModelText",[Wh]:"vModelSelect",[Bo]:"vModelDynamic",[Zh]:"withModifiers",[Jh]:"withKeys",[Yh]:"vShow",[Qh]:"Transition",[Xh]:"TransitionGroup"});let ka;function w0(e,t=!1){return ka||(ka=document.createElement("div")),t?(ka.innerHTML=`
`,ka.children[0].getAttribute("foo")):(ka.innerHTML=e,ka.textContent)}const S0={parseMode:"html",isVoidTag:gg,isNativeTag:e=>pg(e)||hg(e)||mg(e),isPreTag:e=>e==="pre",isIgnoreNewlineTag:e=>e==="pre"||e==="textarea",decodeEntities:w0,isBuiltInComponent:e=>{if(e==="Transition"||e==="transition")return Qh;if(e==="TransitionGroup"||e==="transition-group")return Xh},getNamespace(e,t,s){let n=t?t.ns:s;if(t&&n===2)if(t.tag==="annotation-xml"){if(e==="svg")return 1;t.props.some(a=>a.type===6&&a.name==="encoding"&&a.value!=null&&(a.value.content==="text/html"||a.value.content==="application/xhtml+xml"))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&e!=="mglyph"&&e!=="malignmark"&&(n=0);else t&&n===1&&(t.tag==="foreignObject"||t.tag==="desc"||t.tag==="title")&&(n=0);if(n===0){if(e==="svg")return 1;if(e==="math")return 2}return n}},T0=e=>{e.type===1&&e.props.forEach((t,s)=>{t.type===6&&t.name==="style"&&t.value&&(e.props[s]={type:7,name:"bind",arg:Fe("style",!0,t.loc),exp:C0(t.value.content,t.loc),modifiers:[],loc:t.loc})})},C0=(e,t)=>{const s=ff(e);return Fe(JSON.stringify(s),!1,t,3)};function Bn(e,t){return ut(e,t)}const E0=(e,t,s)=>{const{exp:n,loc:a}=e;return n||s.onError(Bn(54,a)),t.children.length&&(s.onError(Bn(55,a)),t.children.length=0),{props:[wt(Fe("innerHTML",!0,a),n||Fe("",!0))]}},A0=(e,t,s)=>{const{exp:n,loc:a}=e;return n||s.onError(Bn(56,a)),t.children.length&&(s.onError(Bn(57,a)),t.children.length=0),{props:[wt(Fe("textContent",!0),n?ys(n,s)>0?n:It(s.helperString(Ar),[n],a):Fe("",!0))]}},R0=(e,t,s)=>{const n=jh(e,t,s);if(!n.props.length||t.tagType===1)return n;e.arg&&s.onError(Bn(59,e.arg.loc));const{tag:a}=t,i=s.isCustomElement(a);if(a==="input"||a==="textarea"||a==="select"||i){let l=Kh,r=!1;if(a==="input"||i){const o=Rr(t,"type");if(o){if(o.type===7)l=Bo;else if(o.value)switch(o.value.content){case"radio":l=qh;break;case"checkbox":l=Gh;break;case"file":r=!0,s.onError(Bn(60,e.loc));break}}else ux(t)&&(l=Bo)}else a==="select"&&(l=Wh);r||(n.needRuntime=s.helper(l))}else s.onError(Bn(58,e.loc));return n.props=n.props.filter(l=>!(l.key.type===4&&l.key.content==="modelValue")),n},I0=ks("passive,once,capture"),O0=ks("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),N0=ks("left,right"),em=ks("onkeyup,onkeydown,onkeypress"),L0=(e,t,s,n)=>{const a=[],i=[],l=[];for(let r=0;rhs(e)&&e.content.toLowerCase()==="onclick"?Fe(t,!0):e.type!==4?Vs(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,D0=(e,t,s)=>Vh(e,t,s,n=>{const{modifiers:a}=e;if(!a.length)return n;let{key:i,value:l}=n.props[0];const{keyModifiers:r,nonKeyModifiers:o,eventOptionModifiers:c}=L0(i,a,s,e.loc);if(o.includes("right")&&(i=pu(i,"onContextmenu")),o.includes("middle")&&(i=pu(i,"onMouseup")),o.length&&(l=It(s.helper(Zh),[l,JSON.stringify(o)])),r.length&&(!hs(i)||em(i.content.toLowerCase()))&&(l=It(s.helper(Jh),[l,JSON.stringify(r)])),c.length){const d=c.map(ua).join("");i=hs(i)?Fe(`${i.content}${d}`,!0):Vs(["(",i,`) + "${d}"`])}return{props:[wt(i,l)]}}),M0=(e,t,s)=>{const{exp:n,loc:a}=e;return n||s.onError(Bn(62,a)),{props:[],needRuntime:s.helper(Yh)}},P0=(e,t)=>{e.type===1&&e.tagType===0&&(e.tag==="script"||e.tag==="style")&&t.removeNode()},F0=[T0],$0={cloak:k0,html:E0,text:A0,model:R0,on:D0,show:M0};function B0(e,t={}){return _0(e,ze({},S0,t,{nodeTransforms:[P0,...F0,...t.nodeTransforms||[]],directiveTransforms:ze({},$0,t.directiveTransforms||{}),transformHoist:null}))}/** +**/const qh=Symbol(""),Gh=Symbol(""),Kh=Symbol(""),Wh=Symbol(""),Uo=Symbol(""),Zh=Symbol(""),Jh=Symbol(""),Yh=Symbol(""),Qh=Symbol(""),Xh=Symbol("");Xy({[qh]:"vModelRadio",[Gh]:"vModelCheckbox",[Kh]:"vModelText",[Wh]:"vModelSelect",[Uo]:"vModelDynamic",[Zh]:"withModifiers",[Jh]:"withKeys",[Yh]:"vShow",[Qh]:"Transition",[Xh]:"TransitionGroup"});let ka;function w0(e,t=!1){return ka||(ka=document.createElement("div")),t?(ka.innerHTML=`
`,ka.children[0].getAttribute("foo")):(ka.innerHTML=e,ka.textContent)}const S0={parseMode:"html",isVoidTag:gg,isNativeTag:e=>fg(e)||hg(e)||mg(e),isPreTag:e=>e==="pre",isIgnoreNewlineTag:e=>e==="pre"||e==="textarea",decodeEntities:w0,isBuiltInComponent:e=>{if(e==="Transition"||e==="transition")return Qh;if(e==="TransitionGroup"||e==="transition-group")return Xh},getNamespace(e,t,s){let n=t?t.ns:s;if(t&&n===2)if(t.tag==="annotation-xml"){if(e==="svg")return 1;t.props.some(a=>a.type===6&&a.name==="encoding"&&a.value!=null&&(a.value.content==="text/html"||a.value.content==="application/xhtml+xml"))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&e!=="mglyph"&&e!=="malignmark"&&(n=0);else t&&n===1&&(t.tag==="foreignObject"||t.tag==="desc"||t.tag==="title")&&(n=0);if(n===0){if(e==="svg")return 1;if(e==="math")return 2}return n}},T0=e=>{e.type===1&&e.props.forEach((t,s)=>{t.type===6&&t.name==="style"&&t.value&&(e.props[s]={type:7,name:"bind",arg:$e("style",!0,t.loc),exp:C0(t.value.content,t.loc),modifiers:[],loc:t.loc})})},C0=(e,t)=>{const s=up(e);return $e(JSON.stringify(s),!1,t,3)};function Un(e,t){return ut(e,t)}const E0=(e,t,s)=>{const{exp:n,loc:a}=e;return n||s.onError(Un(54,a)),t.children.length&&(s.onError(Un(55,a)),t.children.length=0),{props:[wt($e("innerHTML",!0,a),n||$e("",!0))]}},A0=(e,t,s)=>{const{exp:n,loc:a}=e;return n||s.onError(Un(56,a)),t.children.length&&(s.onError(Un(57,a)),t.children.length=0),{props:[wt($e("textContent",!0),n?ys(n,s)>0?n:It(s.helperString(Ar),[n],a):$e("",!0))]}},R0=(e,t,s)=>{const n=jh(e,t,s);if(!n.props.length||t.tagType===1)return n;e.arg&&s.onError(Un(59,e.arg.loc));const{tag:a}=t,i=s.isCustomElement(a);if(a==="input"||a==="textarea"||a==="select"||i){let l=Kh,r=!1;if(a==="input"||i){const o=Rr(t,"type");if(o){if(o.type===7)l=Uo;else if(o.value)switch(o.value.content){case"radio":l=qh;break;case"checkbox":l=Gh;break;case"file":r=!0,s.onError(Un(60,e.loc));break}}else ux(t)&&(l=Uo)}else a==="select"&&(l=Wh);r||(n.needRuntime=s.helper(l))}else s.onError(Un(58,e.loc));return n.props=n.props.filter(l=>!(l.key.type===4&&l.key.content==="modelValue")),n},I0=ks("passive,once,capture"),O0=ks("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),N0=ks("left,right"),em=ks("onkeyup,onkeydown,onkeypress"),L0=(e,t,s,n)=>{const a=[],i=[],l=[];for(let r=0;rhs(e)&&e.content.toLowerCase()==="onclick"?$e(t,!0):e.type!==4?Vs(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,D0=(e,t,s)=>Vh(e,t,s,n=>{const{modifiers:a}=e;if(!a.length)return n;let{key:i,value:l}=n.props[0];const{keyModifiers:r,nonKeyModifiers:o,eventOptionModifiers:c}=L0(i,a,s,e.loc);if(o.includes("right")&&(i=fu(i,"onContextmenu")),o.includes("middle")&&(i=fu(i,"onMouseup")),o.length&&(l=It(s.helper(Zh),[l,JSON.stringify(o)])),r.length&&(!hs(i)||em(i.content.toLowerCase()))&&(l=It(s.helper(Jh),[l,JSON.stringify(r)])),c.length){const d=c.map(ua).join("");i=hs(i)?$e(`${i.content}${d}`,!0):Vs(["(",i,`) + "${d}"`])}return{props:[wt(i,l)]}}),M0=(e,t,s)=>{const{exp:n,loc:a}=e;return n||s.onError(Un(62,a)),{props:[],needRuntime:s.helper(Yh)}},P0=(e,t)=>{e.type===1&&e.tagType===0&&(e.tag==="script"||e.tag==="style")&&t.removeNode()},F0=[T0],$0={cloak:k0,html:E0,text:A0,model:R0,on:D0,show:M0};function U0(e,t={}){return _0(e,ze({},S0,t,{nodeTransforms:[P0,...F0,...t.nodeTransforms||[]],directiveTransforms:ze({},$0,t.directiveTransforms||{}),transformHoist:null}))}/** * vue v3.5.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const hu=Object.create(null);function U0(e,t){if(!Me(e))if(e.nodeType)e=e.innerHTML;else return Ht;const s=sg(e,t),n=hu[s];if(n)return n;if(e[0]==="#"){const r=document.querySelector(e);e=r?r.innerHTML:""}const a=ze({hoistStatic:!0,onError:void 0,onWarn:Ht},t);!a.isCustomElement&&typeof customElements<"u"&&(a.isCustomElement=r=>!!customElements.get(r));const{code:i}=B0(e,a),l=new Function("Vue",i)(Ky);return l._rc=!0,hu[s]=l}Fp(U0);const ir=Hn({items:[]});let H0=1;function Nr(e,t="info",s=3e3){const n=H0++;return ir.items.push({id:n,message:String(e),type:t}),s>0&&setTimeout(()=>qc(n),s),n}function qc(e){const t=ir.items.findIndex(s=>s.id===e);t>=0&&ir.items.splice(t,1)}function Ae(e,t="info",s=3e3){return Nr(e,t,s)}Ae.success=(e,t=3e3)=>Nr(e,"success",t);Ae.error=(e,t=5e3)=>Nr(e,"error",t);Ae.info=(e,t=3e3)=>Nr(e,"info",t);Ae.dismiss=qc;const z0={setup(){return{state:ir,dismiss:qc}},template:` +**/const hu=Object.create(null);function B0(e,t){if(!Me(e))if(e.nodeType)e=e.innerHTML;else return Ht;const s=sg(e,t),n=hu[s];if(n)return n;if(e[0]==="#"){const r=document.querySelector(e);e=r?r.innerHTML:""}const a=ze({hoistStatic:!0,onError:void 0,onWarn:Ht},t);!a.isCustomElement&&typeof customElements<"u"&&(a.isCustomElement=r=>!!customElements.get(r));const{code:i}=U0(e,a),l=new Function("Vue",i)(Ky);return l._rc=!0,hu[s]=l}Ff(B0);const ir=Hn({items:[]});let H0=1;function Nr(e,t="info",s=3e3){const n=H0++;return ir.items.push({id:n,message:String(e),type:t}),s>0&&setTimeout(()=>qc(n),s),n}function qc(e){const t=ir.items.findIndex(s=>s.id===e);t>=0&&ir.items.splice(t,1)}function Ee(e,t="info",s=3e3){return Nr(e,t,s)}Ee.success=(e,t=3e3)=>Nr(e,"success",t);Ee.error=(e,t=5e3)=>Nr(e,"error",t);Ee.info=(e,t=3e3)=>Nr(e,"info",t);Ee.dismiss=qc;const z0={setup(){return{state:ir,dismiss:qc}},template:`
t in e?Gm(e,t,{enumerable:!0,config
- `},fn=Hn({open:!1,title:"Confirm",message:"",confirmLabel:"Confirm",cancelLabel:"Cancel",danger:!1});let Ua=null;function _s({title:e="Confirm",message:t="",confirmLabel:s="Confirm",cancelLabel:n="Cancel",danger:a=!1}={}){return Ua&&Ua(!1),fn.title=e,fn.message=t,fn.confirmLabel=s,fn.cancelLabel=n,fn.danger=a,fn.open=!0,new Promise(i=>{Ua=i})}function mu(e){fn.open=!1,Ua&&(Ua(e),Ua=null)}const V0={setup(){function e(t){fn.open&&t.key==="Escape"&&(t.stopPropagation(),mu(!1))}return We(()=>document.addEventListener("keydown",e,!0)),xt(()=>document.removeEventListener("keydown",e,!0)),{state:fn,settle:mu}},template:` + `},pn=Hn({open:!1,title:"Confirm",message:"",confirmLabel:"Confirm",cancelLabel:"Cancel",danger:!1});let Ba=null;function _s({title:e="Confirm",message:t="",confirmLabel:s="Confirm",cancelLabel:n="Cancel",danger:a=!1}={}){return Ba&&Ba(!1),pn.title=e,pn.message=t,pn.confirmLabel=s,pn.cancelLabel=n,pn.danger=a,pn.open=!0,new Promise(i=>{Ba=i})}function mu(e){pn.open=!1,Ba&&(Ba(e),Ba=null)}const V0={setup(){function e(t){pn.open&&t.key==="Escape"&&(t.stopPropagation(),mu(!1))}return We(()=>document.addEventListener("keydown",e,!0)),xt(()=>document.removeEventListener("keydown",e,!0)),{state:pn,settle:mu}},template:`
@@ -71,11 +71,11 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const Aa=typeof document<"u";function tm(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function j0(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&tm(e.default)}const nt=Object.assign;function Xr(e,t){const s={};for(const n in t){const a=t[n];s[n]=qs(a)?a.map(e):e(a)}return s}const Ai=()=>{},qs=Array.isArray;function gu(e,t){const s={};for(const n in e)s[n]=n in t?t[n]:e[n];return s}const sm=/#/g,q0=/&/g,G0=/\//g,K0=/=/g,W0=/\?/g,nm=/\+/g,Z0=/%5B/g,J0=/%5D/g,am=/%5E/g,Y0=/%60/g,im=/%7B/g,Q0=/%7C/g,lm=/%7D/g,X0=/%20/g;function Gc(e){return e==null?"":encodeURI(""+e).replace(Q0,"|").replace(Z0,"[").replace(J0,"]")}function e_(e){return Gc(e).replace(im,"{").replace(lm,"}").replace(am,"^")}function Uo(e){return Gc(e).replace(nm,"%2B").replace(X0,"+").replace(sm,"%23").replace(q0,"%26").replace(Y0,"`").replace(im,"{").replace(lm,"}").replace(am,"^")}function t_(e){return Uo(e).replace(K0,"%3D")}function s_(e){return Gc(e).replace(sm,"%23").replace(W0,"%3F")}function n_(e){return s_(e).replace(G0,"%2F")}function Zi(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const a_=/\/$/,i_=e=>e.replace(a_,"");function eo(e,t,s="/"){let n,a={},i="",l="";const r=t.indexOf("#");let o=t.indexOf("?");return o=r>=0&&o>r?-1:o,o>=0&&(n=t.slice(0,o),i=t.slice(o,r>0?r:t.length),a=e(i.slice(1))),r>=0&&(n=n||t.slice(0,r),l=t.slice(r,t.length)),n=c_(n??t,s),{fullPath:n+i+l,path:n,query:a,hash:Zi(l)}}function l_(e,t){const s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function vu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function r_(e,t,s){const n=t.matched.length-1,a=s.matched.length-1;return n>-1&&n===a&&Ya(t.matched[n],s.matched[a])&&rm(t.params,s.params)&&e(t.query)===e(s.query)&&t.hash===s.hash}function Ya(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function rm(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var s in e)if(!o_(e[s],t[s]))return!1;return!0}function o_(e,t){return qs(e)?bu(e,t):qs(t)?bu(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function bu(e,t){return qs(t)?e.length===t.length&&e.every((s,n)=>s===t[n]):e.length===1&&e[0]===t}function c_(e,t){if(e.startsWith("/"))return e;if(!e)return t;const s=t.split("/"),n=e.split("/"),a=n[n.length-1];(a===".."||a===".")&&n.push("");let i=s.length-1,l,r;for(l=0;l1&&i--;else break;return s.slice(0,i).join("/")+"/"+n.slice(l).join("/")}const On={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ho=(function(e){return e.pop="pop",e.push="push",e})({}),to=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function d_(e){if(!e)if(Aa){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),i_(e)}const u_=/^[^#]+#/;function f_(e,t){return e.replace(u_,"#")+t}function p_(e,t){const s=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-s.left-(t.left||0),top:n.top-s.top-(t.top||0)}}const Lr=()=>({left:window.scrollX,top:window.scrollY});function h_(e){let t;if("el"in e){const s=e.el,n=typeof s=="string"&&s.startsWith("#"),a=typeof s=="string"?n?document.getElementById(s.slice(1)):document.querySelector(s):s;if(!a)return;t=p_(a,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function yu(e,t){return(history.state?history.state.position-t:-1)+e}const zo=new Map;function m_(e,t){zo.set(e,t)}function g_(e){const t=zo.get(e);return zo.delete(e),t}function v_(e){return typeof e=="string"||e&&typeof e=="object"}function om(e){return typeof e=="string"||typeof e=="symbol"}let mt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const cm=Symbol("");mt.MATCHER_NOT_FOUND+"",mt.NAVIGATION_GUARD_REDIRECT+"",mt.NAVIGATION_ABORTED+"",mt.NAVIGATION_CANCELLED+"",mt.NAVIGATION_DUPLICATED+"";function Qa(e,t){return nt(new Error,{type:e,[cm]:!0},t)}function rn(e,t){return e instanceof Error&&cm in e&&(t==null||!!(e.type&t))}const b_=["params","query","hash"];function y_(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const s of b_)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function x_(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;na&&Uo(a)):[n&&Uo(n)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+s,a!=null&&(t+="="+a))})}return t}function __(e){const t={};for(const s in e){const n=e[s];n!==void 0&&(t[s]=qs(n)?n.map(a=>a==null?null:""+a):n==null?n:""+n)}return t}const k_=Symbol(""),_u=Symbol(""),Dr=Symbol(""),Kc=Symbol(""),Vo=Symbol("");function fi(){let e=[];function t(n){return e.push(n),()=>{const a=e.indexOf(n);a>-1&&e.splice(a,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Fn(e,t,s,n,a,i=l=>l()){const l=n&&(n.enterCallbacks[a]=n.enterCallbacks[a]||[]);return()=>new Promise((r,o)=>{const c=f=>{f===!1?o(Qa(mt.NAVIGATION_ABORTED,{from:s,to:t})):f instanceof Error?o(f):v_(f)?o(Qa(mt.NAVIGATION_GUARD_REDIRECT,{from:t,to:f})):(l&&n.enterCallbacks[a]===l&&typeof f=="function"&&l.push(f),r())},d=i(()=>e.call(n&&n.instances[a],t,s,c));let u=Promise.resolve(d);e.length<3&&(u=u.then(c)),u.catch(f=>o(f))})}function so(e,t,s,n,a=i=>i()){const i=[];for(const l of e)for(const r in l.components){let o=l.components[r];if(!(t!=="beforeRouteEnter"&&!l.instances[r]))if(tm(o)){const c=(o.__vccOpts||o)[t];c&&i.push(Fn(c,s,n,l,r,a))}else{let c=o();i.push(()=>c.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${r}" at "${l.path}"`);const u=j0(d)?d.default:d;l.mods[r]=d,l.components[r]=u;const f=(u.__vccOpts||u)[t];return f&&Fn(f,s,n,l,r,a)()}))}}return i}function w_(e,t){const s=[],n=[],a=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;lYa(c,r))?n.push(r):s.push(r));const o=e.matched[l];o&&(t.matched.find(c=>Ya(c,o))||a.push(o))}return[s,n,a]}/*! + */const Aa=typeof document<"u";function tm(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function j0(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&tm(e.default)}const nt=Object.assign;function Xr(e,t){const s={};for(const n in t){const a=t[n];s[n]=qs(a)?a.map(e):e(a)}return s}const Ai=()=>{},qs=Array.isArray;function gu(e,t){const s={};for(const n in e)s[n]=n in t?t[n]:e[n];return s}const sm=/#/g,q0=/&/g,G0=/\//g,K0=/=/g,W0=/\?/g,nm=/\+/g,Z0=/%5B/g,J0=/%5D/g,am=/%5E/g,Y0=/%60/g,im=/%7B/g,Q0=/%7C/g,lm=/%7D/g,X0=/%20/g;function Gc(e){return e==null?"":encodeURI(""+e).replace(Q0,"|").replace(Z0,"[").replace(J0,"]")}function e_(e){return Gc(e).replace(im,"{").replace(lm,"}").replace(am,"^")}function Bo(e){return Gc(e).replace(nm,"%2B").replace(X0,"+").replace(sm,"%23").replace(q0,"%26").replace(Y0,"`").replace(im,"{").replace(lm,"}").replace(am,"^")}function t_(e){return Bo(e).replace(K0,"%3D")}function s_(e){return Gc(e).replace(sm,"%23").replace(W0,"%3F")}function n_(e){return s_(e).replace(G0,"%2F")}function Zi(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const a_=/\/$/,i_=e=>e.replace(a_,"");function eo(e,t,s="/"){let n,a={},i="",l="";const r=t.indexOf("#");let o=t.indexOf("?");return o=r>=0&&o>r?-1:o,o>=0&&(n=t.slice(0,o),i=t.slice(o,r>0?r:t.length),a=e(i.slice(1))),r>=0&&(n=n||t.slice(0,r),l=t.slice(r,t.length)),n=c_(n??t,s),{fullPath:n+i+l,path:n,query:a,hash:Zi(l)}}function l_(e,t){const s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function vu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function r_(e,t,s){const n=t.matched.length-1,a=s.matched.length-1;return n>-1&&n===a&&Ya(t.matched[n],s.matched[a])&&rm(t.params,s.params)&&e(t.query)===e(s.query)&&t.hash===s.hash}function Ya(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function rm(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var s in e)if(!o_(e[s],t[s]))return!1;return!0}function o_(e,t){return qs(e)?bu(e,t):qs(t)?bu(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function bu(e,t){return qs(t)?e.length===t.length&&e.every((s,n)=>s===t[n]):e.length===1&&e[0]===t}function c_(e,t){if(e.startsWith("/"))return e;if(!e)return t;const s=t.split("/"),n=e.split("/"),a=n[n.length-1];(a===".."||a===".")&&n.push("");let i=s.length-1,l,r;for(l=0;l1&&i--;else break;return s.slice(0,i).join("/")+"/"+n.slice(l).join("/")}const On={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ho=(function(e){return e.pop="pop",e.push="push",e})({}),to=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function d_(e){if(!e)if(Aa){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),i_(e)}const u_=/^[^#]+#/;function p_(e,t){return e.replace(u_,"#")+t}function f_(e,t){const s=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-s.left-(t.left||0),top:n.top-s.top-(t.top||0)}}const Lr=()=>({left:window.scrollX,top:window.scrollY});function h_(e){let t;if("el"in e){const s=e.el,n=typeof s=="string"&&s.startsWith("#"),a=typeof s=="string"?n?document.getElementById(s.slice(1)):document.querySelector(s):s;if(!a)return;t=f_(a,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function yu(e,t){return(history.state?history.state.position-t:-1)+e}const zo=new Map;function m_(e,t){zo.set(e,t)}function g_(e){const t=zo.get(e);return zo.delete(e),t}function v_(e){return typeof e=="string"||e&&typeof e=="object"}function om(e){return typeof e=="string"||typeof e=="symbol"}let mt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const cm=Symbol("");mt.MATCHER_NOT_FOUND+"",mt.NAVIGATION_GUARD_REDIRECT+"",mt.NAVIGATION_ABORTED+"",mt.NAVIGATION_CANCELLED+"",mt.NAVIGATION_DUPLICATED+"";function Qa(e,t){return nt(new Error,{type:e,[cm]:!0},t)}function rn(e,t){return e instanceof Error&&cm in e&&(t==null||!!(e.type&t))}const b_=["params","query","hash"];function y_(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const s of b_)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function x_(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;na&&Bo(a)):[n&&Bo(n)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+s,a!=null&&(t+="="+a))})}return t}function __(e){const t={};for(const s in e){const n=e[s];n!==void 0&&(t[s]=qs(n)?n.map(a=>a==null?null:""+a):n==null?n:""+n)}return t}const k_=Symbol(""),_u=Symbol(""),Dr=Symbol(""),Kc=Symbol(""),Vo=Symbol("");function pi(){let e=[];function t(n){return e.push(n),()=>{const a=e.indexOf(n);a>-1&&e.splice(a,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function Fn(e,t,s,n,a,i=l=>l()){const l=n&&(n.enterCallbacks[a]=n.enterCallbacks[a]||[]);return()=>new Promise((r,o)=>{const c=p=>{p===!1?o(Qa(mt.NAVIGATION_ABORTED,{from:s,to:t})):p instanceof Error?o(p):v_(p)?o(Qa(mt.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(l&&n.enterCallbacks[a]===l&&typeof p=="function"&&l.push(p),r())},d=i(()=>e.call(n&&n.instances[a],t,s,c));let u=Promise.resolve(d);e.length<3&&(u=u.then(c)),u.catch(p=>o(p))})}function so(e,t,s,n,a=i=>i()){const i=[];for(const l of e)for(const r in l.components){let o=l.components[r];if(!(t!=="beforeRouteEnter"&&!l.instances[r]))if(tm(o)){const c=(o.__vccOpts||o)[t];c&&i.push(Fn(c,s,n,l,r,a))}else{let c=o();i.push(()=>c.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${r}" at "${l.path}"`);const u=j0(d)?d.default:d;l.mods[r]=d,l.components[r]=u;const p=(u.__vccOpts||u)[t];return p&&Fn(p,s,n,l,r,a)()}))}}return i}function w_(e,t){const s=[],n=[],a=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;lYa(c,r))?n.push(r):s.push(r));const o=e.matched[l];o&&(t.matched.find(c=>Ya(c,o))||a.push(o))}return[s,n,a]}/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let S_=()=>location.protocol+"//"+location.host;function dm(e,t){const{pathname:s,search:n,hash:a}=t,i=e.indexOf("#");if(i>-1){let l=a.includes(e.slice(i))?e.slice(i).length:1,r=a.slice(l);return r[0]!=="/"&&(r="/"+r),vu(r,"")}return vu(s,e)+n+a}function T_(e,t,s,n){let a=[],i=[],l=null;const r=({state:f})=>{const p=dm(e,location),b=s.value,y=t.value;let E=0;if(f){if(s.value=p,t.value=f,l&&l===b){l=null;return}E=y?f.position-y.position:0}else n(p);a.forEach(I=>{I(s.value,b,{delta:E,type:Ho.pop,direction:E?E>0?to.forward:to.back:to.unknown})})};function o(){l=s.value}function c(f){a.push(f);const p=()=>{const b=a.indexOf(f);b>-1&&a.splice(b,1)};return i.push(p),p}function d(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(nt({},f.state,{scroll:Lr()}),"")}}function u(){for(const f of i)f();i=[],window.removeEventListener("popstate",r),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",r),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:o,listen:c,destroy:u}}function ku(e,t,s,n=!1,a=!1){return{back:e,current:t,forward:s,replaced:n,position:window.history.length,scroll:a?Lr():null}}function C_(e){const{history:t,location:s}=window,n={value:dm(e,s)},a={value:t.state};a.value||i(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(o,c,d){const u=e.indexOf("#"),f=u>-1?(s.host&&document.querySelector("base")?e:e.slice(u))+o:S_()+e+o;try{t[d?"replaceState":"pushState"](c,"",f),a.value=c}catch(p){console.error(p),s[d?"replace":"assign"](f)}}function l(o,c){i(o,nt({},t.state,ku(a.value.back,o,a.value.forward,!0),c,{position:a.value.position}),!0),n.value=o}function r(o,c){const d=nt({},a.value,t.state,{forward:o,scroll:Lr()});i(d.current,d,!0),i(o,nt({},ku(n.value,o,null),{position:d.position+1},c),!1),n.value=o}return{location:n,state:a,push:r,replace:l}}function E_(e){e=d_(e);const t=C_(e),s=T_(e,t.state,t.location,t.replace);function n(i,l=!0){l||s.pauseListeners(),history.go(i)}const a=nt({location:"",base:e,go:n,createHref:f_.bind(null,e)},t,s);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}function A_(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),E_(e)}let Xn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Et=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Et||{});const R_={type:Xn.Static,value:""},I_=/[a-zA-Z0-9_]/;function O_(e){if(!e)return[[]];if(e==="/")return[[R_]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${s})/"${c}": ${p}`)}let s=Et.Static,n=s;const a=[];let i;function l(){i&&a.push(i),i=[]}let r=0,o,c="",d="";function u(){c&&(s===Et.Static?i.push({type:Xn.Static,value:c}):s===Et.Param||s===Et.ParamRegExp||s===Et.ParamRegExpEnd?(i.length>1&&(o==="*"||o==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Xn.Param,value:c,regexp:d,repeatable:o==="*"||o==="+",optional:o==="*"||o==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=o}for(;rt.length?t.length===1&&t[0]===es.Static+es.Segment?1:-1:0}function um(e,t){let s=0;const n=e.score,a=t.score;for(;s0&&t[t.length-1]<0}const P_={strict:!1,end:!0,sensitive:!1};function F_(e,t,s){const n=D_(O_(e.path),s),a=nt(n,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function $_(e,t){const s=[],n=new Map;t=gu(P_,t);function a(u){return n.get(u)}function i(u,f,p){const b=!p,y=Cu(u);y.aliasOf=p&&p.record;const E=gu(t,u),I=[y];if("alias"in u){const _=typeof u.alias=="string"?[u.alias]:u.alias;for(const S of _)I.push(Cu(nt({},y,{components:p?p.record.components:y.components,path:S,aliasOf:p?p.record:y})))}let x,m;for(const _ of I){const{path:S}=_;if(f&&S[0]!=="/"){const g=f.record.path,w=g[g.length-1]==="/"?"":"/";_.path=f.record.path+(S&&w+S)}if(x=F_(_,f,E),p?p.alias.push(x):(m=m||x,m!==x&&m.alias.push(x),b&&u.name&&!Eu(x)&&l(u.name)),fm(x)&&o(x),y.children){const g=y.children;for(let w=0;w{l(m)}:Ai}function l(u){if(om(u)){const f=n.get(u);f&&(n.delete(u),s.splice(s.indexOf(f),1),f.children.forEach(l),f.alias.forEach(l))}else{const f=s.indexOf(u);f>-1&&(s.splice(f,1),u.record.name&&n.delete(u.record.name),u.children.forEach(l),u.alias.forEach(l))}}function r(){return s}function o(u){const f=H_(u,s);s.splice(f,0,u),u.record.name&&!Eu(u)&&n.set(u.record.name,u)}function c(u,f){let p,b={},y,E;if("name"in u&&u.name){if(p=n.get(u.name),!p)throw Qa(mt.MATCHER_NOT_FOUND,{location:u});E=p.record.name,b=nt(Tu(f.params,p.keys.filter(m=>!m.optional).concat(p.parent?p.parent.keys.filter(m=>m.optional):[]).map(m=>m.name)),u.params&&Tu(u.params,p.keys.map(m=>m.name))),y=p.stringify(b)}else if(u.path!=null)y=u.path,p=s.find(m=>m.re.test(y)),p&&(b=p.parse(y),E=p.record.name);else{if(p=f.name?n.get(f.name):s.find(m=>m.re.test(f.path)),!p)throw Qa(mt.MATCHER_NOT_FOUND,{location:u,currentLocation:f});E=p.record.name,b=nt({},f.params,u.params),y=p.stringify(b)}const I=[];let x=p;for(;x;)I.unshift(x.record),x=x.parent;return{name:E,path:y,params:b,matched:I,meta:U_(I)}}e.forEach(u=>i(u));function d(){s.length=0,n.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:d,getRoutes:r,getRecordMatcher:a}}function Tu(e,t){const s={};for(const n of t)n in e&&(s[n]=e[n]);return s}function Cu(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:B_(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function B_(e){const t={},s=e.props||!1;if("component"in e)t.default=s;else for(const n in e.components)t[n]=typeof s=="object"?s[n]:s;return t}function Eu(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function U_(e){return e.reduce((t,s)=>nt(t,s.meta),{})}function H_(e,t){let s=0,n=t.length;for(;s!==n;){const i=s+n>>1;um(e,t[i])<0?n=i:s=i+1}const a=z_(e);return a&&(n=t.lastIndexOf(a,n-1)),n}function z_(e){let t=e;for(;t=t.parent;)if(fm(t)&&um(e,t)===0)return t}function fm({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Au(e){const t=Os(Dr),s=Os(Kc),n=J(()=>{const o=en(e.to);return t.resolve(o)}),a=J(()=>{const{matched:o}=n.value,{length:c}=o,d=o[c-1],u=s.matched;if(!d||!u.length)return-1;const f=u.findIndex(Ya.bind(null,d));if(f>-1)return f;const p=Ru(o[c-2]);return c>1&&Ru(d)===p&&u[u.length-1].path!==p?u.findIndex(Ya.bind(null,o[c-2])):f}),i=J(()=>a.value>-1&&K_(s.params,n.value.params)),l=J(()=>a.value>-1&&a.value===s.matched.length-1&&rm(s.params,n.value.params));function r(o={}){if(G_(o)){const c=t[en(e.replace)?"replace":"push"](en(e.to)).catch(Ai);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:n,href:J(()=>n.value.href),isActive:i,isExactActive:l,navigate:r}}function V_(e){return e.length===1?e[0]:e}const j_=el({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Au,setup(e,{slots:t}){const s=Hn(Au(e)),{options:n}=Os(Dr),a=J(()=>({[Iu(e.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[Iu(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const i=t.default&&V_(t.default(s));return e.custom?i:ja("a",{"aria-current":s.isExactActive?e.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:a.value},i)}}}),q_=j_;function G_(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function K_(e,t){for(const s in t){const n=t[s],a=e[s];if(typeof n=="string"){if(n!==a)return!1}else if(!qs(a)||a.length!==n.length||n.some((i,l)=>i.valueOf()!==a[l].valueOf()))return!1}return!0}function Ru(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Iu=(e,t,s)=>e??t??s,W_=el({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:s}){const n=Os(Vo),a=J(()=>e.route||n.value),i=Os(_u,0),l=J(()=>{let c=en(i);const{matched:d}=a.value;let u;for(;(u=d[c])&&!u.components;)c++;return c}),r=J(()=>a.value.matched[l.value]);wi(_u,J(()=>l.value+1)),wi(k_,r),wi(Vo,a);const o=h();return ns(()=>[o.value,r.value,e.name],([c,d,u],[f,p,b])=>{d&&(d.instances[u]=c,p&&p!==d&&c&&c===f&&(d.leaveGuards.size||(d.leaveGuards=p.leaveGuards),d.updateGuards.size||(d.updateGuards=p.updateGuards))),c&&d&&(!p||!Ya(d,p)||!f)&&(d.enterCallbacks[u]||[]).forEach(y=>y(c))},{flush:"post"}),()=>{const c=a.value,d=e.name,u=r.value,f=u&&u.components[d];if(!f)return Ou(s.default,{Component:f,route:c});const p=u.props[d],b=p?p===!0?c.params:typeof p=="function"?p(c):p:null,E=ja(f,nt({},b,t,{onVnodeUnmounted:I=>{I.component.isUnmounted&&(u.instances[d]=null)},ref:o}));return Ou(s.default,{Component:E,route:c})||E}}});function Ou(e,t){if(!e)return null;const s=e(t);return s.length===1?s[0]:s}const Z_=W_;function J_(e){const t=$_(e.routes,e),s=e.parseQuery||x_,n=e.stringifyQuery||xu,a=e.history,i=fi(),l=fi(),r=fi(),o=nc(On);let c=On;Aa&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Xr.bind(null,V=>""+V),u=Xr.bind(null,n_),f=Xr.bind(null,Zi);function p(V,de){let ce,ye;return om(V)?(ce=t.getRecordMatcher(V),ye=de):ye=V,t.addRoute(ye,ce)}function b(V){const de=t.getRecordMatcher(V);de&&t.removeRoute(de)}function y(){return t.getRoutes().map(V=>V.record)}function E(V){return!!t.getRecordMatcher(V)}function I(V,de){if(de=nt({},de||o.value),typeof V=="string"){const L=eo(s,V,de.path),$=t.resolve({path:L.path},de),ee=a.createHref(L.fullPath);return nt(L,$,{params:f($.params),hash:Zi(L.hash),redirectedFrom:void 0,href:ee})}let ce;if(V.path!=null)ce=nt({},V,{path:eo(s,V.path,de.path).path});else{const L=nt({},V.params);for(const $ in L)L[$]==null&&delete L[$];ce=nt({},V,{params:u(L)}),de.params=u(de.params)}const ye=t.resolve(ce,de),ge=V.hash||"";ye.params=d(f(ye.params));const He=l_(n,nt({},V,{hash:e_(ge),path:ye.path})),k=a.createHref(He);return nt({fullPath:He,hash:ge,query:n===xu?__(V.query):V.query||{}},ye,{redirectedFrom:void 0,href:k})}function x(V){return typeof V=="string"?eo(s,V,o.value.path):nt({},V)}function m(V,de){if(c!==V)return Qa(mt.NAVIGATION_CANCELLED,{from:de,to:V})}function _(V){return w(V)}function S(V){return _(nt(x(V),{replace:!0}))}function g(V,de){const ce=V.matched[V.matched.length-1];if(ce&&ce.redirect){const{redirect:ye}=ce;let ge=typeof ye=="function"?ye(V,de):ye;return typeof ge=="string"&&(ge=ge.includes("?")||ge.includes("#")?ge=x(ge):{path:ge},ge.params={}),nt({query:V.query,hash:V.hash,params:ge.path!=null?{}:V.params},ge)}}function w(V,de){const ce=c=I(V),ye=o.value,ge=V.state,He=V.force,k=V.replace===!0,L=g(ce,ye);if(L)return w(nt(x(L),{state:typeof L=="object"?nt({},ge,L.state):ge,force:He,replace:k}),de||ce);const $=ce;$.redirectedFrom=de;let ee;return!He&&r_(n,ye,ce)&&(ee=Qa(mt.NAVIGATION_DUPLICATED,{to:$,from:ye}),ke(ye,ye,!0,!1)),(ee?Promise.resolve(ee):M($,ye)).catch(Z=>rn(Z)?rn(Z,mt.NAVIGATION_GUARD_REDIRECT)?Z:we(Z):N(Z,$,ye)).then(Z=>{if(Z){if(rn(Z,mt.NAVIGATION_GUARD_REDIRECT))return w(nt({replace:k},x(Z.to),{state:typeof Z.to=="object"?nt({},ge,Z.to.state):ge,force:He}),de||$)}else Z=P($,ye,!0,k,ge);return H($,ye,Z),Z})}function T(V,de){const ce=m(V,de);return ce?Promise.reject(ce):Promise.resolve()}function C(V){const de=F.values().next().value;return de&&typeof de.runWithContext=="function"?de.runWithContext(V):V()}function M(V,de){let ce;const[ye,ge,He]=w_(V,de);ce=so(ye.reverse(),"beforeRouteLeave",V,de);for(const L of ye)L.leaveGuards.forEach($=>{ce.push(Fn($,V,de))});const k=T.bind(null,V,de);return ce.push(k),Se(ce).then(()=>{ce=[];for(const L of i.list())ce.push(Fn(L,V,de));return ce.push(k),Se(ce)}).then(()=>{ce=so(ge,"beforeRouteUpdate",V,de);for(const L of ge)L.updateGuards.forEach($=>{ce.push(Fn($,V,de))});return ce.push(k),Se(ce)}).then(()=>{ce=[];for(const L of He)if(L.beforeEnter)if(qs(L.beforeEnter))for(const $ of L.beforeEnter)ce.push(Fn($,V,de));else ce.push(Fn(L.beforeEnter,V,de));return ce.push(k),Se(ce)}).then(()=>(V.matched.forEach(L=>L.enterCallbacks={}),ce=so(He,"beforeRouteEnter",V,de,C),ce.push(k),Se(ce))).then(()=>{ce=[];for(const L of l.list())ce.push(Fn(L,V,de));return ce.push(k),Se(ce)}).catch(L=>rn(L,mt.NAVIGATION_CANCELLED)?L:Promise.reject(L))}function H(V,de,ce){r.list().forEach(ye=>C(()=>ye(V,de,ce)))}function P(V,de,ce,ye,ge){const He=m(V,de);if(He)return He;const k=de===On,L=Aa?history.state:{};ce&&(ye||k?a.replace(V.fullPath,nt({scroll:k&&L&&L.scroll},ge)):a.push(V.fullPath,ge)),o.value=V,ke(V,de,ce,k),we()}let R;function j(){R||(R=a.listen((V,de,ce)=>{if(!se.listening)return;const ye=I(V),ge=g(ye,se.currentRoute.value);if(ge){w(nt(ge,{replace:!0,force:!0}),ye).catch(Ai);return}c=ye;const He=o.value;Aa&&m_(yu(He.fullPath,ce.delta),Lr()),M(ye,He).catch(k=>rn(k,mt.NAVIGATION_ABORTED|mt.NAVIGATION_CANCELLED)?k:rn(k,mt.NAVIGATION_GUARD_REDIRECT)?(w(nt(x(k.to),{force:!0}),ye).then(L=>{rn(L,mt.NAVIGATION_ABORTED|mt.NAVIGATION_DUPLICATED)&&!ce.delta&&ce.type===Ho.pop&&a.go(-1,!1)}).catch(Ai),Promise.reject()):(ce.delta&&a.go(-ce.delta,!1),N(k,ye,He))).then(k=>{k=k||P(ye,He,!1),k&&(ce.delta&&!rn(k,mt.NAVIGATION_CANCELLED)?a.go(-ce.delta,!1):ce.type===Ho.pop&&rn(k,mt.NAVIGATION_ABORTED|mt.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),H(ye,He,k)}).catch(Ai)}))}let Q=fi(),U=fi(),O;function N(V,de,ce){we(V);const ye=U.list();return ye.length?ye.forEach(ge=>ge(V,de,ce)):console.error(V),Promise.reject(V)}function Y(){return O&&o.value!==On?Promise.resolve():new Promise((V,de)=>{Q.add([V,de])})}function we(V){return O||(O=!V,j(),Q.list().forEach(([de,ce])=>V?ce(V):de()),Q.reset()),V}function ke(V,de,ce,ye){const{scrollBehavior:ge}=e;if(!Aa||!ge)return Promise.resolve();const He=!ce&&g_(yu(V.fullPath,0))||(ye||!ce)&&history.state&&history.state.scroll||null;return Rt().then(()=>ge(V,de,He)).then(k=>k&&h_(k)).catch(k=>N(k,V,de))}const ie=V=>a.go(V);let he;const F=new Set,se={currentRoute:o,listening:!0,addRoute:p,removeRoute:b,clearRoutes:t.clearRoutes,hasRoute:E,getRoutes:y,resolve:I,options:e,push:_,replace:S,go:ie,back:()=>ie(-1),forward:()=>ie(1),beforeEach:i.add,beforeResolve:l.add,afterEach:r.add,onError:U.add,isReady:Y,install(V){V.component("RouterLink",q_),V.component("RouterView",Z_),V.config.globalProperties.$router=se,Object.defineProperty(V.config.globalProperties,"$route",{enumerable:!0,get:()=>en(o)}),Aa&&!he&&o.value===On&&(he=!0,_(a.location).catch(ye=>{}));const de={};for(const ye in On)Object.defineProperty(de,ye,{get:()=>o.value[ye],enumerable:!0});V.provide(Dr,se),V.provide(Kc,sc(de)),V.provide(Vo,o);const ce=V.unmount;F.add(V),V.unmount=function(){F.delete(V),F.size<1&&(c=On,R&&R(),R=null,o.value=On,he=!1,O=!1),ce()}}};function Se(V){return V.reduce((de,ce)=>de.then(()=>C(ce)),Promise.resolve())}return se}function pm(){return Os(Dr)}function Y_(e){return Os(Kc)}const Mr={props:{tabs:{type:Array,required:!0},defaultTab:{type:String,default:""},groupLabel:{type:String,default:""}},setup(e){const t=Y_(),s=pm(),n=J({get(){var o;const r=t.query.tab;return r&&e.tabs.some(c=>c.id===r)?r:e.defaultTab||((o=e.tabs[0])==null?void 0:o.id)||""},set(r){s.replace({query:{...t.query,tab:r}})}}),a=J(()=>{var r;return((r=e.tabs.find(o=>o.id===n.value))==null?void 0:r.component)||null}),i=J(()=>{var r;return((r=e.tabs.find(o=>o.id===n.value))==null?void 0:r.label)||""});ns(i,r=>{e.groupLabel&&r&&(document.title=`Odin — ${e.groupLabel} › ${r}`)},{immediate:!0});function l(r,o){if(!["ArrowLeft","ArrowRight","Home","End"].includes(r.key))return;r.preventDefault();let c=o;r.key==="ArrowRight"&&(c=(o+1)%e.tabs.length),r.key==="ArrowLeft"&&(c=(o-1+e.tabs.length)%e.tabs.length),r.key==="Home"&&(c=0),r.key==="End"&&(c=e.tabs.length-1),n.value=e.tabs[c].id,requestAnimationFrame(()=>{var d;return(d=document.getElementById("tab-"+e.tabs[c].id))==null?void 0:d.focus()})}return{activeTab:n,activeComponent:a,activeLabel:i,onTabKeydown:l}},template:` + */let S_=()=>location.protocol+"//"+location.host;function dm(e,t){const{pathname:s,search:n,hash:a}=t,i=e.indexOf("#");if(i>-1){let l=a.includes(e.slice(i))?e.slice(i).length:1,r=a.slice(l);return r[0]!=="/"&&(r="/"+r),vu(r,"")}return vu(s,e)+n+a}function T_(e,t,s,n){let a=[],i=[],l=null;const r=({state:p})=>{const f=dm(e,location),b=s.value,y=t.value;let E=0;if(p){if(s.value=f,t.value=p,l&&l===b){l=null;return}E=y?p.position-y.position:0}else n(f);a.forEach(O=>{O(s.value,b,{delta:E,type:Ho.pop,direction:E?E>0?to.forward:to.back:to.unknown})})};function o(){l=s.value}function c(p){a.push(p);const f=()=>{const b=a.indexOf(p);b>-1&&a.splice(b,1)};return i.push(f),f}function d(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(nt({},p.state,{scroll:Lr()}),"")}}function u(){for(const p of i)p();i=[],window.removeEventListener("popstate",r),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",r),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:o,listen:c,destroy:u}}function ku(e,t,s,n=!1,a=!1){return{back:e,current:t,forward:s,replaced:n,position:window.history.length,scroll:a?Lr():null}}function C_(e){const{history:t,location:s}=window,n={value:dm(e,s)},a={value:t.state};a.value||i(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(o,c,d){const u=e.indexOf("#"),p=u>-1?(s.host&&document.querySelector("base")?e:e.slice(u))+o:S_()+e+o;try{t[d?"replaceState":"pushState"](c,"",p),a.value=c}catch(f){console.error(f),s[d?"replace":"assign"](p)}}function l(o,c){i(o,nt({},t.state,ku(a.value.back,o,a.value.forward,!0),c,{position:a.value.position}),!0),n.value=o}function r(o,c){const d=nt({},a.value,t.state,{forward:o,scroll:Lr()});i(d.current,d,!0),i(o,nt({},ku(n.value,o,null),{position:d.position+1},c),!1),n.value=o}return{location:n,state:a,push:r,replace:l}}function E_(e){e=d_(e);const t=C_(e),s=T_(e,t.state,t.location,t.replace);function n(i,l=!0){l||s.pauseListeners(),history.go(i)}const a=nt({location:"",base:e,go:n,createHref:p_.bind(null,e)},t,s);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}function A_(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),E_(e)}let Xn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Et=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Et||{});const R_={type:Xn.Static,value:""},I_=/[a-zA-Z0-9_]/;function O_(e){if(!e)return[[]];if(e==="/")return[[R_]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(f){throw new Error(`ERR (${s})/"${c}": ${f}`)}let s=Et.Static,n=s;const a=[];let i;function l(){i&&a.push(i),i=[]}let r=0,o,c="",d="";function u(){c&&(s===Et.Static?i.push({type:Xn.Static,value:c}):s===Et.Param||s===Et.ParamRegExp||s===Et.ParamRegExpEnd?(i.length>1&&(o==="*"||o==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Xn.Param,value:c,regexp:d,repeatable:o==="*"||o==="+",optional:o==="*"||o==="?"})):t("Invalid state to consume buffer"),c="")}function p(){c+=o}for(;rt.length?t.length===1&&t[0]===es.Static+es.Segment?1:-1:0}function um(e,t){let s=0;const n=e.score,a=t.score;for(;s0&&t[t.length-1]<0}const P_={strict:!1,end:!0,sensitive:!1};function F_(e,t,s){const n=D_(O_(e.path),s),a=nt(n,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function $_(e,t){const s=[],n=new Map;t=gu(P_,t);function a(u){return n.get(u)}function i(u,p,f){const b=!f,y=Cu(u);y.aliasOf=f&&f.record;const E=gu(t,u),O=[y];if("alias"in u){const _=typeof u.alias=="string"?[u.alias]:u.alias;for(const S of _)O.push(Cu(nt({},y,{components:f?f.record.components:y.components,path:S,aliasOf:f?f.record:y})))}let x,m;for(const _ of O){const{path:S}=_;if(p&&S[0]!=="/"){const g=p.record.path,w=g[g.length-1]==="/"?"":"/";_.path=p.record.path+(S&&w+S)}if(x=F_(_,p,E),f?f.alias.push(x):(m=m||x,m!==x&&m.alias.push(x),b&&u.name&&!Eu(x)&&l(u.name)),pm(x)&&o(x),y.children){const g=y.children;for(let w=0;w{l(m)}:Ai}function l(u){if(om(u)){const p=n.get(u);p&&(n.delete(u),s.splice(s.indexOf(p),1),p.children.forEach(l),p.alias.forEach(l))}else{const p=s.indexOf(u);p>-1&&(s.splice(p,1),u.record.name&&n.delete(u.record.name),u.children.forEach(l),u.alias.forEach(l))}}function r(){return s}function o(u){const p=H_(u,s);s.splice(p,0,u),u.record.name&&!Eu(u)&&n.set(u.record.name,u)}function c(u,p){let f,b={},y,E;if("name"in u&&u.name){if(f=n.get(u.name),!f)throw Qa(mt.MATCHER_NOT_FOUND,{location:u});E=f.record.name,b=nt(Tu(p.params,f.keys.filter(m=>!m.optional).concat(f.parent?f.parent.keys.filter(m=>m.optional):[]).map(m=>m.name)),u.params&&Tu(u.params,f.keys.map(m=>m.name))),y=f.stringify(b)}else if(u.path!=null)y=u.path,f=s.find(m=>m.re.test(y)),f&&(b=f.parse(y),E=f.record.name);else{if(f=p.name?n.get(p.name):s.find(m=>m.re.test(p.path)),!f)throw Qa(mt.MATCHER_NOT_FOUND,{location:u,currentLocation:p});E=f.record.name,b=nt({},p.params,u.params),y=f.stringify(b)}const O=[];let x=f;for(;x;)O.unshift(x.record),x=x.parent;return{name:E,path:y,params:b,matched:O,meta:B_(O)}}e.forEach(u=>i(u));function d(){s.length=0,n.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:d,getRoutes:r,getRecordMatcher:a}}function Tu(e,t){const s={};for(const n of t)n in e&&(s[n]=e[n]);return s}function Cu(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:U_(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function U_(e){const t={},s=e.props||!1;if("component"in e)t.default=s;else for(const n in e.components)t[n]=typeof s=="object"?s[n]:s;return t}function Eu(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function B_(e){return e.reduce((t,s)=>nt(t,s.meta),{})}function H_(e,t){let s=0,n=t.length;for(;s!==n;){const i=s+n>>1;um(e,t[i])<0?n=i:s=i+1}const a=z_(e);return a&&(n=t.lastIndexOf(a,n-1)),n}function z_(e){let t=e;for(;t=t.parent;)if(pm(t)&&um(e,t)===0)return t}function pm({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Au(e){const t=Os(Dr),s=Os(Kc),n=J(()=>{const o=en(e.to);return t.resolve(o)}),a=J(()=>{const{matched:o}=n.value,{length:c}=o,d=o[c-1],u=s.matched;if(!d||!u.length)return-1;const p=u.findIndex(Ya.bind(null,d));if(p>-1)return p;const f=Ru(o[c-2]);return c>1&&Ru(d)===f&&u[u.length-1].path!==f?u.findIndex(Ya.bind(null,o[c-2])):p}),i=J(()=>a.value>-1&&K_(s.params,n.value.params)),l=J(()=>a.value>-1&&a.value===s.matched.length-1&&rm(s.params,n.value.params));function r(o={}){if(G_(o)){const c=t[en(e.replace)?"replace":"push"](en(e.to)).catch(Ai);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:n,href:J(()=>n.value.href),isActive:i,isExactActive:l,navigate:r}}function V_(e){return e.length===1?e[0]:e}const j_=el({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Au,setup(e,{slots:t}){const s=Hn(Au(e)),{options:n}=Os(Dr),a=J(()=>({[Iu(e.activeClass,n.linkActiveClass,"router-link-active")]:s.isActive,[Iu(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:s.isExactActive}));return()=>{const i=t.default&&V_(t.default(s));return e.custom?i:ja("a",{"aria-current":s.isExactActive?e.ariaCurrentValue:null,href:s.href,onClick:s.navigate,class:a.value},i)}}}),q_=j_;function G_(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function K_(e,t){for(const s in t){const n=t[s],a=e[s];if(typeof n=="string"){if(n!==a)return!1}else if(!qs(a)||a.length!==n.length||n.some((i,l)=>i.valueOf()!==a[l].valueOf()))return!1}return!0}function Ru(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Iu=(e,t,s)=>e??t??s,W_=el({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:s}){const n=Os(Vo),a=J(()=>e.route||n.value),i=Os(_u,0),l=J(()=>{let c=en(i);const{matched:d}=a.value;let u;for(;(u=d[c])&&!u.components;)c++;return c}),r=J(()=>a.value.matched[l.value]);wi(_u,J(()=>l.value+1)),wi(k_,r),wi(Vo,a);const o=h();return ns(()=>[o.value,r.value,e.name],([c,d,u],[p,f,b])=>{d&&(d.instances[u]=c,f&&f!==d&&c&&c===p&&(d.leaveGuards.size||(d.leaveGuards=f.leaveGuards),d.updateGuards.size||(d.updateGuards=f.updateGuards))),c&&d&&(!f||!Ya(d,f)||!p)&&(d.enterCallbacks[u]||[]).forEach(y=>y(c))},{flush:"post"}),()=>{const c=a.value,d=e.name,u=r.value,p=u&&u.components[d];if(!p)return Ou(s.default,{Component:p,route:c});const f=u.props[d],b=f?f===!0?c.params:typeof f=="function"?f(c):f:null,E=ja(p,nt({},b,t,{onVnodeUnmounted:O=>{O.component.isUnmounted&&(u.instances[d]=null)},ref:o}));return Ou(s.default,{Component:E,route:c})||E}}});function Ou(e,t){if(!e)return null;const s=e(t);return s.length===1?s[0]:s}const Z_=W_;function J_(e){const t=$_(e.routes,e),s=e.parseQuery||x_,n=e.stringifyQuery||xu,a=e.history,i=pi(),l=pi(),r=pi(),o=nc(On);let c=On;Aa&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Xr.bind(null,B=>""+B),u=Xr.bind(null,n_),p=Xr.bind(null,Zi);function f(B,ie){let le,xe;return om(B)?(le=t.getRecordMatcher(B),xe=ie):xe=B,t.addRoute(xe,le)}function b(B){const ie=t.getRecordMatcher(B);ie&&t.removeRoute(ie)}function y(){return t.getRoutes().map(B=>B.record)}function E(B){return!!t.getRecordMatcher(B)}function O(B,ie){if(ie=nt({},ie||o.value),typeof B=="string"){const L=eo(s,B,ie.path),F=t.resolve({path:L.path},ie),ee=a.createHref(L.fullPath);return nt(L,F,{params:p(F.params),hash:Zi(L.hash),redirectedFrom:void 0,href:ee})}let le;if(B.path!=null)le=nt({},B,{path:eo(s,B.path,ie.path).path});else{const L=nt({},B.params);for(const F in L)L[F]==null&&delete L[F];le=nt({},B,{params:u(L)}),ie.params=u(ie.params)}const xe=t.resolve(le,ie),ge=B.hash||"";xe.params=d(p(xe.params));const Fe=l_(n,nt({},B,{hash:e_(ge),path:xe.path})),k=a.createHref(Fe);return nt({fullPath:Fe,hash:ge,query:n===xu?__(B.query):B.query||{}},xe,{redirectedFrom:void 0,href:k})}function x(B){return typeof B=="string"?eo(s,B,o.value.path):nt({},B)}function m(B,ie){if(c!==B)return Qa(mt.NAVIGATION_CANCELLED,{from:ie,to:B})}function _(B){return w(B)}function S(B){return _(nt(x(B),{replace:!0}))}function g(B,ie){const le=B.matched[B.matched.length-1];if(le&&le.redirect){const{redirect:xe}=le;let ge=typeof xe=="function"?xe(B,ie):xe;return typeof ge=="string"&&(ge=ge.includes("?")||ge.includes("#")?ge=x(ge):{path:ge},ge.params={}),nt({query:B.query,hash:B.hash,params:ge.path!=null?{}:B.params},ge)}}function w(B,ie){const le=c=O(B),xe=o.value,ge=B.state,Fe=B.force,k=B.replace===!0,L=g(le,xe);if(L)return w(nt(x(L),{state:typeof L=="object"?nt({},ge,L.state):ge,force:Fe,replace:k}),ie||le);const F=le;F.redirectedFrom=ie;let ee;return!Fe&&r_(n,xe,le)&&(ee=Qa(mt.NAVIGATION_DUPLICATED,{to:F,from:xe}),we(xe,xe,!0,!1)),(ee?Promise.resolve(ee):M(F,xe)).catch(Z=>rn(Z)?rn(Z,mt.NAVIGATION_GUARD_REDIRECT)?Z:Se(Z):I(Z,F,xe)).then(Z=>{if(Z){if(rn(Z,mt.NAVIGATION_GUARD_REDIRECT))return w(nt({replace:k},x(Z.to),{state:typeof Z.to=="object"?nt({},ge,Z.to.state):ge,force:Fe}),ie||F)}else Z=P(F,xe,!0,k,ge);return H(F,xe,Z),Z})}function T(B,ie){const le=m(B,ie);return le?Promise.reject(le):Promise.resolve()}function C(B){const ie=se.values().next().value;return ie&&typeof ie.runWithContext=="function"?ie.runWithContext(B):B()}function M(B,ie){let le;const[xe,ge,Fe]=w_(B,ie);le=so(xe.reverse(),"beforeRouteLeave",B,ie);for(const L of xe)L.leaveGuards.forEach(F=>{le.push(Fn(F,B,ie))});const k=T.bind(null,B,ie);return le.push(k),W(le).then(()=>{le=[];for(const L of i.list())le.push(Fn(L,B,ie));return le.push(k),W(le)}).then(()=>{le=so(ge,"beforeRouteUpdate",B,ie);for(const L of ge)L.updateGuards.forEach(F=>{le.push(Fn(F,B,ie))});return le.push(k),W(le)}).then(()=>{le=[];for(const L of Fe)if(L.beforeEnter)if(qs(L.beforeEnter))for(const F of L.beforeEnter)le.push(Fn(F,B,ie));else le.push(Fn(L.beforeEnter,B,ie));return le.push(k),W(le)}).then(()=>(B.matched.forEach(L=>L.enterCallbacks={}),le=so(Fe,"beforeRouteEnter",B,ie,C),le.push(k),W(le))).then(()=>{le=[];for(const L of l.list())le.push(Fn(L,B,ie));return le.push(k),W(le)}).catch(L=>rn(L,mt.NAVIGATION_CANCELLED)?L:Promise.reject(L))}function H(B,ie,le){r.list().forEach(xe=>C(()=>xe(B,ie,le)))}function P(B,ie,le,xe,ge){const Fe=m(B,ie);if(Fe)return Fe;const k=ie===On,L=Aa?history.state:{};le&&(xe||k?a.replace(B.fullPath,nt({scroll:k&&L&&L.scroll},ge)):a.push(B.fullPath,ge)),o.value=B,we(B,ie,le,k),Se()}let R;function V(){R||(R=a.listen((B,ie,le)=>{if(!me.listening)return;const xe=O(B),ge=g(xe,me.currentRoute.value);if(ge){w(nt(ge,{replace:!0,force:!0}),xe).catch(Ai);return}c=xe;const Fe=o.value;Aa&&m_(yu(Fe.fullPath,le.delta),Lr()),M(xe,Fe).catch(k=>rn(k,mt.NAVIGATION_ABORTED|mt.NAVIGATION_CANCELLED)?k:rn(k,mt.NAVIGATION_GUARD_REDIRECT)?(w(nt(x(k.to),{force:!0}),xe).then(L=>{rn(L,mt.NAVIGATION_ABORTED|mt.NAVIGATION_DUPLICATED)&&!le.delta&&le.type===Ho.pop&&a.go(-1,!1)}).catch(Ai),Promise.reject()):(le.delta&&a.go(-le.delta,!1),I(k,xe,Fe))).then(k=>{k=k||P(xe,Fe,!1),k&&(le.delta&&!rn(k,mt.NAVIGATION_CANCELLED)?a.go(-le.delta,!1):le.type===Ho.pop&&rn(k,mt.NAVIGATION_ABORTED|mt.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),H(xe,Fe,k)}).catch(Ai)}))}let Q=pi(),U=pi(),N;function I(B,ie,le){Se(B);const xe=U.list();return xe.length?xe.forEach(ge=>ge(B,ie,le)):console.error(B),Promise.reject(B)}function Y(){return N&&o.value!==On?Promise.resolve():new Promise((B,ie)=>{Q.add([B,ie])})}function Se(B){return N||(N=!B,V(),Q.list().forEach(([ie,le])=>B?le(B):ie()),Q.reset()),B}function we(B,ie,le,xe){const{scrollBehavior:ge}=e;if(!Aa||!ge)return Promise.resolve();const Fe=!le&&g_(yu(B.fullPath,0))||(xe||!le)&&history.state&&history.state.scroll||null;return Rt().then(()=>ge(B,ie,Fe)).then(k=>k&&h_(k)).catch(k=>I(k,B,ie))}const re=B=>a.go(B);let he;const se=new Set,me={currentRoute:o,listening:!0,addRoute:f,removeRoute:b,clearRoutes:t.clearRoutes,hasRoute:E,getRoutes:y,resolve:O,options:e,push:_,replace:S,go:re,back:()=>re(-1),forward:()=>re(1),beforeEach:i.add,beforeResolve:l.add,afterEach:r.add,onError:U.add,isReady:Y,install(B){B.component("RouterLink",q_),B.component("RouterView",Z_),B.config.globalProperties.$router=me,Object.defineProperty(B.config.globalProperties,"$route",{enumerable:!0,get:()=>en(o)}),Aa&&!he&&o.value===On&&(he=!0,_(a.location).catch(xe=>{}));const ie={};for(const xe in On)Object.defineProperty(ie,xe,{get:()=>o.value[xe],enumerable:!0});B.provide(Dr,me),B.provide(Kc,sc(ie)),B.provide(Vo,o);const le=B.unmount;se.add(B),B.unmount=function(){se.delete(B),se.size<1&&(c=On,R&&R(),R=null,o.value=On,he=!1,N=!1),le()}}};function W(B){return B.reduce((ie,le)=>ie.then(()=>C(le)),Promise.resolve())}return me}function fm(){return Os(Dr)}function Y_(e){return Os(Kc)}const Mr={props:{tabs:{type:Array,required:!0},defaultTab:{type:String,default:""},groupLabel:{type:String,default:""}},setup(e){const t=Y_(),s=fm(),n=J({get(){var o;const r=t.query.tab;return r&&e.tabs.some(c=>c.id===r)?r:e.defaultTab||((o=e.tabs[0])==null?void 0:o.id)||""},set(r){s.replace({query:{...t.query,tab:r}})}}),a=J(()=>{var r;return((r=e.tabs.find(o=>o.id===n.value))==null?void 0:r.component)||null}),i=J(()=>{var r;return((r=e.tabs.find(o=>o.id===n.value))==null?void 0:r.label)||""});ns(i,r=>{e.groupLabel&&r&&(document.title=`Odin — ${e.groupLabel} › ${r}`)},{immediate:!0});function l(r,o){if(!["ArrowLeft","ArrowRight","Home","End"].includes(r.key))return;r.preventDefault();let c=o;r.key==="ArrowRight"&&(c=(o+1)%e.tabs.length),r.key==="ArrowLeft"&&(c=(o-1+e.tabs.length)%e.tabs.length),r.key==="Home"&&(c=0),r.key==="End"&&(c=e.tabs.length-1),n.value=e.tabs[c].id,requestAnimationFrame(()=>{var d;return(d=document.getElementById("tab-"+e.tabs[c].id))==null?void 0:d.focus()})}return{activeTab:n,activeComponent:a,activeLabel:i,onTabKeydown:l}},template:`
@@ -90,9 +90,9 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `},Q_={setup(){const e=h([]),t=h([]),s=h({}),n=50;function a(f){var y,E,I,x,m;const p=f.payload||f,b=p.type||f.type;if(b==="tool_start"){const _=((y=p.metadata)==null?void 0:y.call_id)||null,S={callId:_,id:_||`${p.action}-${Date.now()}`,tool:p.action,actor:p.actor||"",channel:p.channel_id||"",iteration:((E=p.metadata)==null?void 0:E.iteration)??0,startTime:Date.now(),elapsed:0,status:"running",output:"",result:""};e.value.unshift(S);return}if(b==="tool_end"){const _=((I=p.metadata)==null?void 0:I.call_id)||null;let S=-1;if(_&&(S=e.value.findIndex(g=>g.callId===_&&g.status==="running")),S<0&&!_)for(let g=e.value.length-1;g>=0;g--){const w=e.value[g];if(w.tool===p.action&&w.status==="running"){S=g;break}}if(S>=0){const g=e.value[S];g.status=(x=p.metadata)!=null&&x.error?"error":"success",g.elapsed=((m=p.metadata)==null?void 0:m.elapsed_ms)||Date.now()-g.startTime,g.result=p.detail||"",g.fadingOut=!0,setTimeout(()=>{const w=e.value.indexOf(g);w>=0&&e.value.splice(w,1),t.value.unshift(g),t.value.length>n&&t.value.pop()},5e3)}return}if(b==="tool_stream"){const _=p.call_id||p.tool_name||"unknown";if(p.finished){const S={...s.value};delete S[_],s.value=S}else{const g=((s.value[_]||"")+(p.chunk||"")).split(` + `},Q_={setup(){const e=h([]),t=h([]),s=h({}),n=50;function a(p){var y,E,O,x,m;const f=p.payload||p,b=f.type||p.type;if(b==="tool_start"){const _=((y=f.metadata)==null?void 0:y.call_id)||null,S={callId:_,id:_||`${f.action}-${Date.now()}`,tool:f.action,actor:f.actor||"",channel:f.channel_id||"",iteration:((E=f.metadata)==null?void 0:E.iteration)??0,startTime:Date.now(),elapsed:0,status:"running",output:"",result:""};e.value.unshift(S);return}if(b==="tool_end"){const _=((O=f.metadata)==null?void 0:O.call_id)||null;let S=-1;if(_&&(S=e.value.findIndex(g=>g.callId===_&&g.status==="running")),S<0&&!_)for(let g=e.value.length-1;g>=0;g--){const w=e.value[g];if(w.tool===f.action&&w.status==="running"){S=g;break}}if(S>=0){const g=e.value[S];g.status=(x=f.metadata)!=null&&x.error?"error":"success",g.elapsed=((m=f.metadata)==null?void 0:m.elapsed_ms)||Date.now()-g.startTime,g.result=f.detail||"",g.fadingOut=!0,setTimeout(()=>{const w=e.value.indexOf(g);w>=0&&e.value.splice(w,1),t.value.unshift(g),t.value.length>n&&t.value.pop()},5e3)}return}if(b==="tool_stream"){const _=f.call_id||f.tool_name||"unknown";if(f.finished){const S={...s.value};delete S[_],s.value=S}else{const g=((s.value[_]||"")+(f.chunk||"")).split(` `);s.value={...s.value,[_]:g.slice(-30).join(` -`)}}return}}let i=null;function l(){const f=Date.now();e.value.forEach(p=>{p.status==="running"&&(p.elapsed=f-p.startTime)})}let r=!1;function o(){r||(r=!0,Ke.on("events",a),i||(i=setInterval(l,500)))}function c(){r&&(r=!1,Ke.off("events",a),i&&(clearInterval(i),i=null))}We(o),Ds(o),Ms(c),xt(c);function d(f){return f<1e3?`${f}ms`:`${(f/1e3).toFixed(1)}s`}function u(f){return f==="running"?"clock":f==="success"?"success":f==="error"?"error":"info"}return{activeTasks:e,recentHistory:t,streamOutput:s,formatMs:d,statusIcon:u}},template:` +`)}}return}}let i=null;function l(){const p=Date.now();e.value.forEach(f=>{f.status==="running"&&(f.elapsed=p-f.startTime)})}let r=!1;function o(){r||(r=!0,Ke.on("events",a),i||(i=setInterval(l,500)))}function c(){r&&(r=!1,Ke.off("events",a),i&&(clearInterval(i),i=null))}We(o),Ds(o),Ms(c),xt(c);function d(p){return p<1e3?`${p}ms`:`${(p/1e3).toFixed(1)}s`}function u(p){return p==="running"?"clock":p==="success"?"success":p==="error"?"error":"info"}return{activeTasks:e,recentHistory:t,streamOutput:s,formatMs:d,statusIcon:u}},template:`

Execution Viewer @@ -155,8 +155,8 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config

- `};function Wc(e){if(e instanceof Date)return e;if(typeof e=="string"){const t=new Date(e);return isNaN(t.getTime())?null:t}return typeof e=="number"&&isFinite(e)?new Date(e<1e12?e*1e3:e):null}function pa(e){const t=Wc(e);return t?t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"—"}function hm(e){const t=Wc(e);return t?t.toLocaleTimeString():"—"}function mm(e){const t=Wc(e);if(!t)return"—";const s=Math.max(0,Math.floor((Date.now()-t.getTime())/1e3));return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:`${Math.floor(s/86400)}d ago`}function X_(e){if(e==null||!isFinite(e))return"—";const t=Math.max(0,Math.floor(Number(e)));return t<60?"less than 1 min ago":t<3600?`${Math.floor(t/60)} min ago`:t<86400?`${Math.floor(t/3600)} hr ago`:`${Math.floor(t/86400)} day ago`}function Xa(e){if(e==null||!isFinite(e))return"—";const t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;if(t<3600){const a=Math.floor(t/60),i=t%60;return i?`${a}m ${i}s`:`${a}m`}const s=Math.floor(t/3600),n=Math.floor(t%3600/60);return n?`${s}h ${n}m`:`${s}h`}function Zc(e,t=200){const s=String(e??"");return s.length>t?s.slice(0,t)+"…":s}function gm(e,t=5e3){const s=String(e??"");return s.length>t?s.slice(0,t)+` -... (truncated)`:s}function Nu(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function vm(e){return e==null||!isFinite(e)?"—":Number(e).toLocaleString()}function bm(e){return e==null||!isFinite(e)?"—":e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const ym=Symbol("agent-detail-cancelled"),ek=15e3;function tk(e,{timeoutMs:t,timeoutLabel:s,scheduleTimeout:n,cancelTimeout:a}){const i=typeof AbortController=="function"?new AbortController:null;let l=null,r=!1,o,c;const d=new Promise((p,b)=>{o=p,c=b});function u(p,b){r||(r=!0,l!==null&&a(l),l=null,(p?o:c)(b))}let f;try{f=e(i==null?void 0:i.signal)}catch(p){u(!1,p)}return r||Promise.resolve(f).then(p=>u(!0,p),p=>u(!1,p)),!r&&Number.isFinite(t)&&t>0&&(l=n(()=>{const p=Math.max(1,Math.round(t/1e3));u(!1,new Error(`${s} request timed out after ${p}s`)),i==null||i.abort()},t)),{promise:d,cancel(){u(!0,ym),i==null||i.abort()}}}function xm({state:e,requestDetail:t,timeoutMs:s=ek,detailLabel:n="Agent detail",scheduleTimeout:a=globalThis.setTimeout.bind(globalThis),cancelTimeout:i=globalThis.clearTimeout.bind(globalThis)}){if(!e||typeof e!="object")throw new TypeError("agent detail state is required");if(typeof t!="function")throw new TypeError("requestDetail must be a function");let l=null;function r(){const f=l;l=null,f==null||f.cancel()}function o(f,{initial:p,coalesce:b}){if(!f)return Promise.resolve();if(b&&l&&l.agentId===f&&e.detailId===f)return l.promise;r();const y={agentId:f,cancel:null,promise:null};l=y,p?(e.detail=null,e.detailError=null,e.detailLoading=!0):e.detail===null&&e.detailError===null&&(e.detailLoading=!0);const E=tk(I=>t(f,{signal:I}),{timeoutMs:s,timeoutLabel:n,scheduleTimeout:a,cancelTimeout:i});return y.cancel=E.cancel,y.promise=(async()=>{let I=null,x=null;try{I=await E.promise}catch(m){x=m}I!==ym&&(l!==y||e.detailId!==f||(l=null,!x&&(I===null||typeof I!="object")&&(x=new Error(`${n} response was empty or invalid`)),x?e.detail===null&&(e.detailError=(x==null?void 0:x.message)||`Failed to load ${n.toLowerCase()}`):(e.detail=I,e.detailError=null),e.detailLoading=!1))})(),y.promise}function c(f){return e.detailId=f,o(f,{initial:!0,coalesce:!1})}function d(){const f=e.detailId;return f?o(f,{initial:!1,coalesce:!0}):Promise.resolve()}function u(){r(),e.detailId=null,e.detail=null,e.detailError=null,e.detailLoading=!1}return{open:c,refresh:d,close:u,hasInFlight:()=>l!==null}}function sk({isEnabled:e,refreshList:t,hasOpenDetail:s,refreshDetail:n,intervalMs:a=5e3,scheduleInterval:i=globalThis.setInterval.bind(globalThis),cancelInterval:l=globalThis.clearInterval.bind(globalThis)}){let r=null;function o(){e()&&(t(),s()&&n())}function c(){r!==null&&(l(r),r=null)}function d(){c(),e()&&(r=i(o,a))}function u(){e()?d():c()}return{start:d,stop:c,sync:u,isRunning:()=>r!==null}}const nk={template:` + `};function Wc(e){if(e instanceof Date)return e;if(typeof e=="string"){const t=new Date(e);return isNaN(t.getTime())?null:t}return typeof e=="number"&&isFinite(e)?new Date(e<1e12?e*1e3:e):null}function fa(e){const t=Wc(e);return t?t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"—"}function hm(e){const t=Wc(e);return t?t.toLocaleTimeString():"—"}function mm(e){const t=Wc(e);if(!t)return"—";const s=Math.max(0,Math.floor((Date.now()-t.getTime())/1e3));return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:`${Math.floor(s/86400)}d ago`}function X_(e){if(e==null||!isFinite(e))return"—";const t=Math.max(0,Math.floor(Number(e)));return t<60?"less than 1 min ago":t<3600?`${Math.floor(t/60)} min ago`:t<86400?`${Math.floor(t/3600)} hr ago`:`${Math.floor(t/86400)} day ago`}function Xa(e){if(e==null||!isFinite(e))return"—";const t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;if(t<3600){const a=Math.floor(t/60),i=t%60;return i?`${a}m ${i}s`:`${a}m`}const s=Math.floor(t/3600),n=Math.floor(t%3600/60);return n?`${s}h ${n}m`:`${s}h`}function Zc(e,t=200){const s=String(e??"");return s.length>t?s.slice(0,t)+"…":s}function gm(e,t=5e3){const s=String(e??"");return s.length>t?s.slice(0,t)+` +... (truncated)`:s}function Nu(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function vm(e){return e==null||!isFinite(e)?"—":Number(e).toLocaleString()}function bm(e){return e==null||!isFinite(e)?"—":e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}const ym=Symbol("agent-detail-cancelled"),ek=15e3;function tk(e,{timeoutMs:t,timeoutLabel:s,scheduleTimeout:n,cancelTimeout:a}){const i=typeof AbortController=="function"?new AbortController:null;let l=null,r=!1,o,c;const d=new Promise((f,b)=>{o=f,c=b});function u(f,b){r||(r=!0,l!==null&&a(l),l=null,(f?o:c)(b))}let p;try{p=e(i==null?void 0:i.signal)}catch(f){u(!1,f)}return r||Promise.resolve(p).then(f=>u(!0,f),f=>u(!1,f)),!r&&Number.isFinite(t)&&t>0&&(l=n(()=>{const f=Math.max(1,Math.round(t/1e3));u(!1,new Error(`${s} request timed out after ${f}s`)),i==null||i.abort()},t)),{promise:d,cancel(){u(!0,ym),i==null||i.abort()}}}function xm({state:e,requestDetail:t,timeoutMs:s=ek,detailLabel:n="Agent detail",scheduleTimeout:a=globalThis.setTimeout.bind(globalThis),cancelTimeout:i=globalThis.clearTimeout.bind(globalThis)}){if(!e||typeof e!="object")throw new TypeError("agent detail state is required");if(typeof t!="function")throw new TypeError("requestDetail must be a function");let l=null;function r(){const p=l;l=null,p==null||p.cancel()}function o(p,{initial:f,coalesce:b}){if(!p)return Promise.resolve();if(b&&l&&l.agentId===p&&e.detailId===p)return l.promise;r();const y={agentId:p,cancel:null,promise:null};l=y,f?(e.detail=null,e.detailError=null,e.detailLoading=!0):e.detail===null&&e.detailError===null&&(e.detailLoading=!0);const E=tk(O=>t(p,{signal:O}),{timeoutMs:s,timeoutLabel:n,scheduleTimeout:a,cancelTimeout:i});return y.cancel=E.cancel,y.promise=(async()=>{let O=null,x=null;try{O=await E.promise}catch(m){x=m}O!==ym&&(l!==y||e.detailId!==p||(l=null,!x&&(O===null||typeof O!="object")&&(x=new Error(`${n} response was empty or invalid`)),x?e.detail===null&&(e.detailError=(x==null?void 0:x.message)||`Failed to load ${n.toLowerCase()}`):(e.detail=O,e.detailError=null),e.detailLoading=!1))})(),y.promise}function c(p){return e.detailId=p,o(p,{initial:!0,coalesce:!1})}function d(){const p=e.detailId;return p?o(p,{initial:!1,coalesce:!0}):Promise.resolve()}function u(){r(),e.detailId=null,e.detail=null,e.detailError=null,e.detailLoading=!1}return{open:c,refresh:d,close:u,hasInFlight:()=>l!==null}}function sk({isEnabled:e,refreshList:t,hasOpenDetail:s,refreshDetail:n,intervalMs:a=5e3,scheduleInterval:i=globalThis.setInterval.bind(globalThis),cancelInterval:l=globalThis.clearInterval.bind(globalThis)}){let r=null;function o(){e()&&(t(),s()&&n())}function c(){r!==null&&(l(r),r=null)}function d(){c(),e()&&(r=i(o,a))}function u(){e()?d():c()}return{start:d,stop:c,sync:u,isRunning:()=>r!==null}}const nk={template:`

Agents

@@ -430,7 +430,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
-
`,setup(){const e=h([]),t=h(!0),s=h(null),n=h(null),a=h(!0),i=h("all");let l=!1;const r=J(()=>e.value.filter(N=>N.status==="running").length),o=J(()=>e.value.filter(N=>N.status==="completed").length),c=J(()=>e.value.filter(N=>["failed","timeout","killed"].includes(N.status)).length),d=J(()=>[{value:"all",label:"All",count:e.value.length},{value:"running",label:"Running",count:r.value},{value:"completed",label:"Completed",count:o.value},{value:"failed",label:"Failed",count:c.value}]),u=J(()=>i.value==="all"?e.value:i.value==="failed"?e.value.filter(N=>["failed","timeout","killed"].includes(N.status)):e.value.filter(N=>N.status===i.value));function f(N){const Y=Number(N.max_iterations)||0;return Y<=0?0:Math.min(100,Math.round(N.iteration_count/Y*100))}function p(N){return(Number(N.max_iterations)||0)>0}function b(N,Y){return N?N==="N/A"?"N/A":Y==="current_inheritance"?`inherit (currently ${N})`:N:"unknown"}function y(N){return b(N.display_model,N.display_model_source||N.display_source)}function E(N){return b(N.display_reasoning_effort,N.display_reasoning_effort_source||N.display_source)}function I(N){return{last_execution:"last executed",current_inheritance:"inherited from current config — not yet executed",spawn_override_pending:"requested at spawn — not yet executed",unknown:"no execution data"}[N]||""}const x=h(null),m=h(null),_=h(!1),S=h(null),g=h(""),T=xm({state:{get detail(){return x.value},set detail(N){x.value=N},get detailId(){return m.value},set detailId(N){m.value=N},get detailLoading(){return _.value},set detailLoading(N){_.value=N},get detailError(){return S.value},set detailError(N){S.value=N}},requestDetail:(N,{signal:Y})=>G.get(`/api/agents/${encodeURIComponent(N)}`,{signal:Y})});async function C(N){g.value="",await T.open(N.id)}function M(){T.close(),g.value=""}async function H(){await T.refresh()}async function P(N,Y){try{await navigator.clipboard.writeText(Y||""),g.value=N,setTimeout(()=>{g.value===N&&(g.value="")},1500)}catch{Ae.error("Copy failed")}}async function R(N=!1){N=N===!0,N||(t.value=!0);try{const Y=await G.get("/api/agents");e.value=Array.isArray(Y)?Y:[],s.value=null}catch(Y){N||(s.value=Y.message)}N||(t.value=!1)}async function j(N){const Y=e.value.find(ke=>ke.id===N);if(await _s({title:"Kill agent",message:`Kill agent "${(Y==null?void 0:Y.label)||N}"? Its current work will be lost.`,confirmLabel:"Kill",danger:!0})){n.value=N;try{await G.del(`/api/agents/${encodeURIComponent(N)}`),Ae.success("Agent killed"),await R()}catch(ke){Ae.error(ke.message||"Failed to kill agent")}n.value=null}}const Q=sk({isEnabled:()=>a.value&&l,refreshList:()=>R(!0),hasOpenDetail:()=>!!m.value,refreshDetail:H});function U(){Q.start()}function O(){Q.stop()}return ns(a,()=>Q.sync()),We(()=>{l=!0,R(),U()}),Ds(()=>{l=!0,R(!0),U()}),Ms(()=>{l=!1,O()}),xt(()=>{l=!1,O(),T.close()}),{agents:e,loading:t,error:s,killing:n,autoRefresh:a,statusFilter:i,runningCount:r,completedCount:o,failedCount:c,statusFilters:d,filteredAgents:u,formatTs:pa,formatDuration:Xa,progressPercent:f,hasProgress:p,displayModelText:y,displayEffortText:E,displaySourceLabel:I,detail:x,detailId:m,detailLoading:_,detailError:S,copied:g,openDetail:C,closeDetail:M,copyText:P,fetchAgents:R,killAgent:j,startAutoRefresh:U,stopAutoRefresh:O}}},ak={template:` +
`,setup(){const e=h([]),t=h(!0),s=h(null),n=h(null),a=h(!0),i=h("all");let l=!1;const r=J(()=>e.value.filter(I=>I.status==="running").length),o=J(()=>e.value.filter(I=>I.status==="completed").length),c=J(()=>e.value.filter(I=>["failed","timeout","killed"].includes(I.status)).length),d=J(()=>[{value:"all",label:"All",count:e.value.length},{value:"running",label:"Running",count:r.value},{value:"completed",label:"Completed",count:o.value},{value:"failed",label:"Failed",count:c.value}]),u=J(()=>i.value==="all"?e.value:i.value==="failed"?e.value.filter(I=>["failed","timeout","killed"].includes(I.status)):e.value.filter(I=>I.status===i.value));function p(I){const Y=Number(I.max_iterations)||0;return Y<=0?0:Math.min(100,Math.round(I.iteration_count/Y*100))}function f(I){return(Number(I.max_iterations)||0)>0}function b(I,Y){return I?I==="N/A"?"N/A":Y==="current_inheritance"?`inherit (currently ${I})`:I:"unknown"}function y(I){return b(I.display_model,I.display_model_source||I.display_source)}function E(I){return b(I.display_reasoning_effort,I.display_reasoning_effort_source||I.display_source)}function O(I){return{last_execution:"last executed",current_inheritance:"inherited from current config — not yet executed",spawn_override_pending:"requested at spawn — not yet executed",unknown:"no execution data"}[I]||""}const x=h(null),m=h(null),_=h(!1),S=h(null),g=h(""),T=xm({state:{get detail(){return x.value},set detail(I){x.value=I},get detailId(){return m.value},set detailId(I){m.value=I},get detailLoading(){return _.value},set detailLoading(I){_.value=I},get detailError(){return S.value},set detailError(I){S.value=I}},requestDetail:(I,{signal:Y})=>q.get(`/api/agents/${encodeURIComponent(I)}`,{signal:Y})});async function C(I){g.value="",await T.open(I.id)}function M(){T.close(),g.value=""}async function H(){await T.refresh()}async function P(I,Y){try{await navigator.clipboard.writeText(Y||""),g.value=I,setTimeout(()=>{g.value===I&&(g.value="")},1500)}catch{Ee.error("Copy failed")}}async function R(I=!1){I=I===!0,I||(t.value=!0);try{const Y=await q.get("/api/agents");e.value=Array.isArray(Y)?Y:[],s.value=null}catch(Y){I||(s.value=Y.message)}I||(t.value=!1)}async function V(I){const Y=e.value.find(we=>we.id===I);if(await _s({title:"Kill agent",message:`Kill agent "${(Y==null?void 0:Y.label)||I}"? Its current work will be lost.`,confirmLabel:"Kill",danger:!0})){n.value=I;try{await q.del(`/api/agents/${encodeURIComponent(I)}`),Ee.success("Agent killed"),await R()}catch(we){Ee.error(we.message||"Failed to kill agent")}n.value=null}}const Q=sk({isEnabled:()=>a.value&&l,refreshList:()=>R(!0),hasOpenDetail:()=>!!m.value,refreshDetail:H});function U(){Q.start()}function N(){Q.stop()}return ns(a,()=>Q.sync()),We(()=>{l=!0,R(),U()}),Ds(()=>{l=!0,R(!0),U()}),Ms(()=>{l=!1,N()}),xt(()=>{l=!1,N(),T.close()}),{agents:e,loading:t,error:s,killing:n,autoRefresh:a,statusFilter:i,runningCount:r,completedCount:o,failedCount:c,statusFilters:d,filteredAgents:u,formatTs:fa,formatDuration:Xa,progressPercent:p,hasProgress:f,displayModelText:y,displayEffortText:E,displaySourceLabel:O,detail:x,detailId:m,detailLoading:_,detailError:S,copied:g,openDetail:C,closeDetail:M,copyText:P,fetchAgents:R,killAgent:V,startAutoRefresh:U,stopAutoRefresh:N}}},ak={template:`

Autonomous Loops

@@ -696,7 +696,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(!1),a=h({goal:"",interval_seconds:60,mode:"notify",max_iterations:50,stop_condition:"",channel_id:""}),i=h(!1),l=h(null),r=h(null),o=h(null),c=h(null),d=h(null),u=h(!1),f=h(null),p=h("");let b=!1;const E=xm({state:{get detail(){return c.value},set detail(O){c.value=O},get detailId(){return d.value},set detailId(O){d.value=O},get detailLoading(){return u.value},set detailLoading(O){u.value=O},get detailError(){return f.value},set detailError(O){f.value=O}},detailLabel:"Loop detail",requestDetail:(O,{signal:N})=>G.get(`/api/loops/${encodeURIComponent(O)}?limit=100`,{signal:N})});async function I(O){p.value="",await E.open(O.id)}function x(){E.close(),p.value=""}async function m(O,N){try{await navigator.clipboard.writeText(N||""),p.value=O,setTimeout(()=>{p.value===O&&(p.value="")},1500)}catch{Ae.error("Copy failed")}}const _=J(()=>e.value.reduce((O,N)=>O+(N.iteration_count||0),0)),S=J(()=>e.value.filter(O=>O.status==="running").length);function g(O){return O==="running"?"loop-status-running":O==="error"?"loop-status-error":"loop-status-stopped"}function w(O){return O==="running"?"badge-success":O==="error"?"badge-danger":O==="completed"?"badge-info":"badge-warning"}function T(O){return O==="act"?"badge-warning":O==="silent"?"badge-info":"badge-success"}async function C(O=!1){O=O===!0,O||(t.value=!0);try{const N=await G.get("/api/loops");e.value=Array.isArray(N)?N:[],s.value=null}catch(N){O||(s.value=N.message)}O||(t.value=!1)}async function M(){l.value=null;const O=a.value;if(!O.goal.trim()){l.value="Goal is required";return}if(!O.channel_id.trim()){l.value="Channel ID is required";return}const N={goal:O.goal.trim(),channel_id:O.channel_id.trim(),interval_seconds:O.interval_seconds||60,mode:O.mode,max_iterations:O.max_iterations||50};O.stop_condition.trim()&&(N.stop_condition=O.stop_condition.trim()),i.value=!0;try{const Y=await G.post("/api/loops",N);Ae.success(`Loop started: ${Y.loop_id}`),a.value={goal:"",interval_seconds:60,mode:"notify",max_iterations:50,stop_condition:"",channel_id:""},n.value=!1,await C()}catch(Y){l.value=Y.message}i.value=!1}async function H(O){if(await _s({title:"Stop loop",message:`Stop loop ${O}? The current iteration will finish before stopping.`,confirmLabel:"Stop Loop",danger:!0})){r.value=O;try{await G.del(`/api/loops/${encodeURIComponent(O)}`),Ae.success("Loop stopped"),await C()}catch(Y){Ae.error(Y.message||"Failed to stop loop")}r.value=null}}async function P(O){o.value=O;try{await G.post(`/api/loops/${encodeURIComponent(O)}/restart`),Ae.success("Loop restarted"),await C()}catch(N){Ae.error(N.message||"Failed to restart loop")}o.value=null}function R(O){b&&O.payload&&(O.payload.loop_id||O.payload.type==="loop")&&(C(!0),d.value&&E.refresh())}let j=null;function Q(){j!==null&&clearInterval(j),j=null}function U(){Q(),b&&(j=setInterval(()=>{C(!0),d.value&&E.refresh()},5e3))}return We(()=>{b=!0,C(),Ke.subscribe("events",R),U()}),Ds(()=>{b=!0,C(!0),U()}),Ms(()=>{b=!1,Q()}),xt(()=>{b=!1,Ke.unsubscribe("events",R),Q(),E.close()}),{loops:e,loading:t,error:s,showCreate:n,form:a,creating:i,createError:l,stoppingId:r,restartingId:o,detail:c,detailId:d,detailLoading:u,detailError:f,copied:p,totalIterations:_,runningCount:S,statusDotClass:g,statusBadge:w,modeBadge:T,formatAge:mm,formatDuration:Xa,formatTs:pa,formatTokens:bm,openDetail:I,closeDetail:x,copyText:m,fetchLoops:C,doCreate:M,doStop:H,doRestart:P}}},ik={template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(!1),a=h({goal:"",interval_seconds:60,mode:"notify",max_iterations:50,stop_condition:"",channel_id:""}),i=h(!1),l=h(null),r=h(null),o=h(null),c=h(null),d=h(null),u=h(!1),p=h(null),f=h("");let b=!1;const E=xm({state:{get detail(){return c.value},set detail(N){c.value=N},get detailId(){return d.value},set detailId(N){d.value=N},get detailLoading(){return u.value},set detailLoading(N){u.value=N},get detailError(){return p.value},set detailError(N){p.value=N}},detailLabel:"Loop detail",requestDetail:(N,{signal:I})=>q.get(`/api/loops/${encodeURIComponent(N)}?limit=100`,{signal:I})});async function O(N){f.value="",await E.open(N.id)}function x(){E.close(),f.value=""}async function m(N,I){try{await navigator.clipboard.writeText(I||""),f.value=N,setTimeout(()=>{f.value===N&&(f.value="")},1500)}catch{Ee.error("Copy failed")}}const _=J(()=>e.value.reduce((N,I)=>N+(I.iteration_count||0),0)),S=J(()=>e.value.filter(N=>N.status==="running").length);function g(N){return N==="running"?"loop-status-running":N==="error"?"loop-status-error":"loop-status-stopped"}function w(N){return N==="running"?"badge-success":N==="error"?"badge-danger":N==="completed"?"badge-info":"badge-warning"}function T(N){return N==="act"?"badge-warning":N==="silent"?"badge-info":"badge-success"}async function C(N=!1){N=N===!0,N||(t.value=!0);try{const I=await q.get("/api/loops");e.value=Array.isArray(I)?I:[],s.value=null}catch(I){N||(s.value=I.message)}N||(t.value=!1)}async function M(){l.value=null;const N=a.value;if(!N.goal.trim()){l.value="Goal is required";return}if(!N.channel_id.trim()){l.value="Channel ID is required";return}const I={goal:N.goal.trim(),channel_id:N.channel_id.trim(),interval_seconds:N.interval_seconds||60,mode:N.mode,max_iterations:N.max_iterations||50};N.stop_condition.trim()&&(I.stop_condition=N.stop_condition.trim()),i.value=!0;try{const Y=await q.post("/api/loops",I);Ee.success(`Loop started: ${Y.loop_id}`),a.value={goal:"",interval_seconds:60,mode:"notify",max_iterations:50,stop_condition:"",channel_id:""},n.value=!1,await C()}catch(Y){l.value=Y.message}i.value=!1}async function H(N){if(await _s({title:"Stop loop",message:`Stop loop ${N}? The current iteration will finish before stopping.`,confirmLabel:"Stop Loop",danger:!0})){r.value=N;try{await q.del(`/api/loops/${encodeURIComponent(N)}`),Ee.success("Loop stopped"),await C()}catch(Y){Ee.error(Y.message||"Failed to stop loop")}r.value=null}}async function P(N){o.value=N;try{await q.post(`/api/loops/${encodeURIComponent(N)}/restart`),Ee.success("Loop restarted"),await C()}catch(I){Ee.error(I.message||"Failed to restart loop")}o.value=null}function R(N){b&&N.payload&&(N.payload.loop_id||N.payload.type==="loop")&&(C(!0),d.value&&E.refresh())}let V=null;function Q(){V!==null&&clearInterval(V),V=null}function U(){Q(),b&&(V=setInterval(()=>{C(!0),d.value&&E.refresh()},5e3))}return We(()=>{b=!0,C(),Ke.subscribe("events",R),U()}),Ds(()=>{b=!0,C(!0),U()}),Ms(()=>{b=!1,Q()}),xt(()=>{b=!1,Ke.unsubscribe("events",R),Q(),E.close()}),{loops:e,loading:t,error:s,showCreate:n,form:a,creating:i,createError:l,stoppingId:r,restartingId:o,detail:c,detailId:d,detailLoading:u,detailError:p,copied:f,totalIterations:_,runningCount:S,statusDotClass:g,statusBadge:w,modeBadge:T,formatAge:mm,formatDuration:Xa,formatTs:fa,formatTokens:bm,openDetail:O,closeDetail:x,copyText:m,fetchLoops:C,doCreate:M,doStop:H,doRestart:P}}},ik={template:`
@@ -789,7 +789,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
-
`,setup(){const e=h([]),t=h(!0),s=h(null),n=h(!0);let a=null;const i=h(null),l=J(()=>e.value.filter(x=>x.status==="running").length),r=J(()=>e.value.filter(x=>x.status!=="running").length);function o(x){return x==="running"?"loop-status-running":x==="failed"||x==="error"?"loop-status-error":"loop-status-stopped"}function c(x){return x==="running"?"badge-success":x==="completed"||x==="exited"?"badge-info":x==="killed"||x==="error"||x==="failed"?"badge-danger":"badge-warning"}async function d(x=!1){x=x===!0,x||(t.value=!0);try{e.value=await G.get("/api/processes"),s.value=null}catch(m){x||(s.value=m.message)}x||(t.value=!1)}function u(){f(),n.value&&(a=setInterval(()=>{t.value||d(!0)},5e3))}function f(){a&&(clearInterval(a),a=null)}ns(n,x=>{x?u():f()});async function p(x){if(await _s({title:"Kill process",message:`Kill process ${x}?`,confirmLabel:"Kill",danger:!0})){i.value=x;try{await G.del(`/api/processes/${x}`),Ae.success(`Process ${x} killed`),await d()}catch(_){Ae.error(_.message||"Failed to kill process")}i.value=null}}function b(x){x.payload&&(x.payload.pid||x.payload.type==="process")&&d(!0)}let y=!1;function E(){y||(y=!0,d(),Ke.subscribe("events",b),u())}function I(){y&&(y=!1,Ke.unsubscribe("events",b),f())}return We(E),Ds(E),Ms(I),xt(I),{processes:e,loading:t,error:s,autoRefresh:n,killingPid:i,runningCount:l,completedCount:r,procStatusDot:o,statusBadge:c,formatDuration:Xa,fetchProcesses:d,doKill:p}}},lk=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;function Lu(e,t){return t==="cron"&&String(e.cron||"").trim()?e.run_at="":t==="run_at"&&String(e.run_at||"").trim()&&(e.cron=""),e}function rk(e,t=!1){const s=a=>String(a).padStart(2,"0"),n=`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())}T${s(e.getHours())}:${s(e.getMinutes())}`;return t?`${n}:${s(e.getSeconds())}`:n}function ok(e){const t=-e.getTimezoneOffset(),s=t>=0?"+":"-",n=Math.abs(t),a=Math.floor(n/60),i=n%60;return`UTC${s}${a}${i?`:${String(i).padStart(2,"0")}`:""}`}function ck(e){const t=String(e||"").trim();if(!t)return{state:"empty"};const s=lk.exec(t);if(!s)return{state:"invalid",typed:t};const[,n,a,i,l,r]=s.slice(0,6).map(Number),o=s[6]===void 0?0:Number(s[6]);if(o>59)return{state:"invalid",typed:t};const c=s[6]!==void 0,d=c?t.slice(0,19):t.slice(0,16),u=Date.UTC(n,a-1,i,l,r,o),f=new Date(u-864e5).getTimezoneOffset(),p=new Date(u+864e5).getTimezoneOffset(),b=[];for(const E of new Set([f,p])){const I=new Date(u+E*6e4);rk(I,c)===d&&(b.some(x=>x.getTime()===I.getTime())||b.push(I))}if(b.sort((E,I)=>E.getTime()-I.getTime()),b.length===0)return{state:"nonexistent",typed:t};if(b.length>1)return{state:"ambiguous",typed:t,options:b.map(E=>({instant:E,offset:ok(E),iso:E.toISOString()}))};const y=b[0];return{state:"ok",typed:t,instant:y,iso:y.toISOString()}}const dk={template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(!0);let a=null;const i=h(null),l=J(()=>e.value.filter(x=>x.status==="running").length),r=J(()=>e.value.filter(x=>x.status!=="running").length);function o(x){return x==="running"?"loop-status-running":x==="failed"||x==="error"?"loop-status-error":"loop-status-stopped"}function c(x){return x==="running"?"badge-success":x==="completed"||x==="exited"?"badge-info":x==="killed"||x==="error"||x==="failed"?"badge-danger":"badge-warning"}async function d(x=!1){x=x===!0,x||(t.value=!0);try{e.value=await q.get("/api/processes"),s.value=null}catch(m){x||(s.value=m.message)}x||(t.value=!1)}function u(){p(),n.value&&(a=setInterval(()=>{t.value||d(!0)},5e3))}function p(){a&&(clearInterval(a),a=null)}ns(n,x=>{x?u():p()});async function f(x){if(await _s({title:"Kill process",message:`Kill process ${x}?`,confirmLabel:"Kill",danger:!0})){i.value=x;try{await q.del(`/api/processes/${x}`),Ee.success(`Process ${x} killed`),await d()}catch(_){Ee.error(_.message||"Failed to kill process")}i.value=null}}function b(x){x.payload&&(x.payload.pid||x.payload.type==="process")&&d(!0)}let y=!1;function E(){y||(y=!0,d(),Ke.subscribe("events",b),u())}function O(){y&&(y=!1,Ke.unsubscribe("events",b),p())}return We(E),Ds(E),Ms(O),xt(O),{processes:e,loading:t,error:s,autoRefresh:n,killingPid:i,runningCount:l,completedCount:r,procStatusDot:o,statusBadge:c,formatDuration:Xa,fetchProcesses:d,doKill:f}}},lk=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;function Lu(e,t){return t==="cron"&&String(e.cron||"").trim()?e.run_at="":t==="run_at"&&String(e.run_at||"").trim()&&(e.cron=""),e}function rk(e,t=!1){const s=a=>String(a).padStart(2,"0"),n=`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())}T${s(e.getHours())}:${s(e.getMinutes())}`;return t?`${n}:${s(e.getSeconds())}`:n}function ok(e){const t=-e.getTimezoneOffset(),s=t>=0?"+":"-",n=Math.abs(t),a=Math.floor(n/60),i=n%60;return`UTC${s}${a}${i?`:${String(i).padStart(2,"0")}`:""}`}function ck(e){const t=String(e||"").trim();if(!t)return{state:"empty"};const s=lk.exec(t);if(!s)return{state:"invalid",typed:t};const[,n,a,i,l,r]=s.slice(0,6).map(Number),o=s[6]===void 0?0:Number(s[6]);if(o>59)return{state:"invalid",typed:t};const c=s[6]!==void 0,d=c?t.slice(0,19):t.slice(0,16),u=Date.UTC(n,a-1,i,l,r,o),p=new Date(u-864e5).getTimezoneOffset(),f=new Date(u+864e5).getTimezoneOffset(),b=[];for(const E of new Set([p,f])){const O=new Date(u+E*6e4);rk(O,c)===d&&(b.some(x=>x.getTime()===O.getTime())||b.push(O))}if(b.sort((E,O)=>E.getTime()-O.getTime()),b.length===0)return{state:"nonexistent",typed:t};if(b.length>1)return{state:"ambiguous",typed:t,options:b.map(E=>({instant:E,offset:ok(E),iso:E.toISOString()}))};const y=b[0];return{state:"ok",typed:t,instant:y,iso:y.toISOString()}}const dk={template:`
@@ -914,6 +914,17 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config placeholder='e.g. {"host":"server1"}' />
+
+ +

+ Requires the command to emit the generic paginated JSON contract. +

+
{{ createError }}
@@ -1059,6 +1070,18 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
ID: {{ s.id }}
Action: {{ s.action }}
+
+ +
+
Report: plain text
Next run: {{ formatFuture(s.next_run) }} on trigger @@ -1103,7 +1126,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
-
`,setup(){const e=h([]),t=h(!0),s=h(null),n=h(!1),a=h({description:"",action:"reminder",channel_id:"",cron:"",run_at:"",message:"",tool_name:"",tool_input_str:""}),i=h(!1),l=h(null),r=h(null),o=J(()=>ck(a.value.run_at));ns(()=>a.value.run_at,()=>{r.value=null});const c=J(()=>{var se;const F=o.value;return F.state==="ok"?F.instant:F.state==="ambiguous"&&r.value!==null&&((se=F.options[r.value])==null?void 0:se.instant)||null}),d=J(()=>{const F=c.value;return F?`${F.toLocaleString()} local — ${F.toISOString()} UTC`:""}),u=h(null),f=h(!1),p=[{label:"Every hour",expr:"0 * * * *"},{label:"Every 6h",expr:"0 */6 * * *"},{label:"Daily 9am",expr:"0 9 * * *"},{label:"Weekly Mon",expr:"0 9 * * 1"},{label:"Every 30m",expr:"*/30 * * * *"}],b=h(null),y=h(null),E=h(null),I=h(null),x=h(null),m=h([]),_=h(!1),S=h("");let g=0;const w=J(()=>e.value.filter(F=>F.cron&&!F.one_time).length),T=J(()=>e.value.filter(F=>F.one_time).length),C=J(()=>e.value.filter(F=>F.trigger).length),M=J(()=>e.value.filter(F=>F.paused).length),H=J(()=>e.value.filter(F=>F.consecutive_failures>0).length);function P(F){if(!F)return"-";const se=Date.now(),V=(new Date(F).getTime()-se)/1e3;if(V<0)return"overdue";if(V<60)return"in < 1 min";if(V<3600)return`in ${Math.floor(V/60)} min`;if(V<86400){const ce=Math.floor(V/3600),ye=Math.floor(V%3600/60);return ye>0?`in ${ce}h ${ye}m`:`in ${ce}h`}const de=Math.floor(V/86400);return`in ${de} day${de!==1?"s":""}`}function R(F){return F==null?"-":F<1e3?`${F}ms`:F<6e4?`${(F/1e3).toFixed(1)}s`:Xa(F/1e3)}function j(F=a.value.cron){a.value.cron=F,Lu(a.value,"cron"),u.value=null}function Q(F=a.value.run_at){a.value.run_at=F,Lu(a.value,"run_at"),u.value=null}async function U(){const F=a.value.cron.trim();if(F){f.value=!0;try{u.value=await G.post("/api/schedules/validate-cron",{expression:F})}catch(se){u.value={valid:!1,error:se.message}}f.value=!1}}async function O(){t.value=!0,s.value=null;try{e.value=await G.get("/api/schedules")}catch(F){s.value=F.message}t.value=!1}async function N(F){if(x.value===F){x.value=null,m.value=[];return}x.value=F,_.value=!0,m.value=[];const se=++g;try{const Se=await G.get(`/api/schedules/${encodeURIComponent(F)}/history?limit=10`);if(se!==g||x.value!==F)return;m.value=Se,S.value=""}catch(Se){if(se!==g||x.value!==F)return;m.value=[],S.value=Se.message||"Failed to load execution history"}se===g&&(_.value=!1)}async function Y(){l.value=null;const F=a.value;if(!F.description.trim()){l.value="Description is required";return}if(!F.channel_id.trim()){l.value="Channel ID is required";return}if(!F.cron.trim()&&!F.run_at.trim()){l.value="Cron expression or run_at time is required";return}if(F.cron.trim()&&F.run_at.trim()){l.value="Choose either Cron or One-Time, not both";return}const se={description:F.description.trim(),action:F.action,channel_id:F.channel_id.trim()};if(F.cron.trim()&&(se.cron=F.cron.trim()),F.run_at.trim()){const Se=o.value;if(Se.state==="nonexistent"){l.value="That local time does not exist (daylight saving gap)";return}if(Se.state==="invalid"){l.value="One-time run time is not a valid date";return}const V=c.value;if(Se.state==="ambiguous"&&r.value===null){l.value="That local time happens twice — choose which occurrence to use";return}if(!V){l.value="One-time run time could not be resolved";return}se.run_at=V.toISOString()}if(F.action==="reminder"&&F.message.trim()&&(se.message=F.message.trim()),F.action==="check"&&(F.tool_name.trim()&&(se.tool_name=F.tool_name.trim()),F.tool_input_str.trim()))try{se.tool_input=JSON.parse(F.tool_input_str.trim())}catch{l.value="Tool input must be valid JSON";return}i.value=!0;try{await G.post("/api/schedules",se),Ae.success("Schedule created"),a.value={description:"",action:"reminder",channel_id:"",cron:"",run_at:"",message:"",tool_name:"",tool_input_str:""},u.value=null,n.value=!1,await O()}catch(Se){l.value=Se.message}i.value=!1}async function we(F){b.value=F;try{const se=await G.post(`/api/schedules/${encodeURIComponent(F)}/run`);if(se.status==="failure")Ae.error(`Execution failed: ${se.error||"unknown error"}`);else{const Se=se.warning?`Executed (${se.warning})`:"Executed successfully";Ae.success(Se)}await O()}catch(se){Ae.error(se.message||"Failed to trigger")}b.value=null}async function ke(F){E.value=F.id;const se=!F.paused;try{await G.put(`/api/schedules/${encodeURIComponent(F.id)}`,{paused:se}),Ae.success(se?"Schedule paused":"Schedule resumed"),await O()}catch(Se){Ae.error(Se.message||"Failed to update schedule")}E.value=null}async function ie(F){I.value=F;try{await G.post(`/api/schedules/${encodeURIComponent(F)}/reset-failures`),Ae.success("Failure counters reset"),await O()}catch(se){Ae.error(se.message||"Failed to reset")}I.value=null}async function he(F){const se=e.value.find(V=>V.id===F);if(await _s({title:"Delete schedule",message:`Delete "${(se==null?void 0:se.description)||F}"? This cannot be undone.`,confirmLabel:"Delete",danger:!0})){y.value=F;try{await G.del(`/api/schedules/${encodeURIComponent(F)}`),Ae.success("Schedule deleted"),await O()}catch(V){Ae.error(V.message||"Failed to delete schedule")}y.value=null}}return We(()=>{O()}),{schedules:e,loading:t,error:s,showCreate:n,form:a,creating:i,createError:l,runAtUtcPreview:d,runAtAnalysis:o,runAtOccurrence:r,cronResult:u,validatingCron:f,cronPresets:p,runningId:b,deletingId:y,togglingId:E,resettingId:I,expandedId:x,history:m,historyLoading:_,historyError:S,cronCount:w,oneTimeCount:T,webhookCount:C,pausedCount:M,failingCount:H,formatTs:pa,formatAge:mm,formatFuture:P,formatMs:R,formatDuration:Xa,onCronInput:j,onRunAtInput:Q,validateCron:U,toggleExpand:N,fetchSchedules:O,doCreate:Y,doRunNow:we,doTogglePause:ke,doResetFailures:ie,doDelete:he}}},_m=[{id:"live",label:"Live",component:Q_},{id:"agents",label:"Agents",component:nk},{id:"loops",label:"Loops",component:ak},{id:"processes",label:"Processes",component:ik},{id:"schedules",label:"Schedules",component:dk}],uk={components:{TabbedPage:Mr},setup(){return{tabs:_m}},template:''},fk={template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(!1),a=h({description:"",action:"reminder",channel_id:"",cron:"",run_at:"",message:"",tool_name:"",tool_input_str:"",report_format:""}),i=h(!1),l=h(null),r=h(null),o=J(()=>ck(a.value.run_at));ns(()=>a.value.run_at,()=>{r.value=null});const c=J(()=>{var B;const W=o.value;return W.state==="ok"?W.instant:W.state==="ambiguous"&&r.value!==null&&((B=W.options[r.value])==null?void 0:B.instant)||null}),d=J(()=>{const W=c.value;return W?`${W.toLocaleString()} local — ${W.toISOString()} UTC`:""}),u=h(null),p=h(!1),f=[{label:"Every hour",expr:"0 * * * *"},{label:"Every 6h",expr:"0 */6 * * *"},{label:"Daily 9am",expr:"0 9 * * *"},{label:"Weekly Mon",expr:"0 9 * * 1"},{label:"Every 30m",expr:"*/30 * * * *"}],b=h(null),y=h(null),E=h(null),O=h(null),x=h(null),m=h(null),_=h([]),S=h(!1),g=h("");let w=0;const T=J(()=>e.value.filter(W=>W.cron&&!W.one_time).length),C=J(()=>e.value.filter(W=>W.one_time).length),M=J(()=>e.value.filter(W=>W.trigger).length),H=J(()=>e.value.filter(W=>W.paused).length),P=J(()=>e.value.filter(W=>W.consecutive_failures>0).length);function R(W){if(!W)return"-";const B=Date.now(),le=(new Date(W).getTime()-B)/1e3;if(le<0)return"overdue";if(le<60)return"in < 1 min";if(le<3600)return`in ${Math.floor(le/60)} min`;if(le<86400){const ge=Math.floor(le/3600),Fe=Math.floor(le%3600/60);return Fe>0?`in ${ge}h ${Fe}m`:`in ${ge}h`}const xe=Math.floor(le/86400);return`in ${xe} day${xe!==1?"s":""}`}function V(W){return W==null?"-":W<1e3?`${W}ms`:W<6e4?`${(W/1e3).toFixed(1)}s`:Xa(W/1e3)}function Q(W=a.value.cron){a.value.cron=W,Lu(a.value,"cron"),u.value=null}function U(W=a.value.run_at){a.value.run_at=W,Lu(a.value,"run_at"),u.value=null}async function N(){const W=a.value.cron.trim();if(W){p.value=!0;try{u.value=await q.post("/api/schedules/validate-cron",{expression:W})}catch(B){u.value={valid:!1,error:B.message}}p.value=!1}}async function I(){t.value=!0,s.value=null;try{e.value=await q.get("/api/schedules")}catch(W){s.value=W.message}t.value=!1}async function Y(W){if(m.value===W){m.value=null,_.value=[];return}m.value=W,S.value=!0,_.value=[];const B=++w;try{const ie=await q.get(`/api/schedules/${encodeURIComponent(W)}/history?limit=10`);if(B!==w||m.value!==W)return;_.value=ie,g.value=""}catch(ie){if(B!==w||m.value!==W)return;_.value=[],g.value=ie.message||"Failed to load execution history"}B===w&&(S.value=!1)}async function Se(){l.value=null;const W=a.value;if(!W.description.trim()){l.value="Description is required";return}if(!W.channel_id.trim()){l.value="Channel ID is required";return}if(!W.cron.trim()&&!W.run_at.trim()){l.value="Cron expression or run_at time is required";return}if(W.cron.trim()&&W.run_at.trim()){l.value="Choose either Cron or One-Time, not both";return}const B={description:W.description.trim(),action:W.action,channel_id:W.channel_id.trim()};if(W.cron.trim()&&(B.cron=W.cron.trim()),W.run_at.trim()){const ie=o.value;if(ie.state==="nonexistent"){l.value="That local time does not exist (daylight saving gap)";return}if(ie.state==="invalid"){l.value="One-time run time is not a valid date";return}const le=c.value;if(ie.state==="ambiguous"&&r.value===null){l.value="That local time happens twice — choose which occurrence to use";return}if(!le){l.value="One-time run time could not be resolved";return}B.run_at=le.toISOString()}if(W.action==="reminder"&&W.message.trim()&&(B.message=W.message.trim()),W.action==="check"&&(W.tool_name.trim()&&(B.tool_name=W.tool_name.trim()),W.report_format&&(B.report_format=W.report_format),W.tool_input_str.trim()))try{B.tool_input=JSON.parse(W.tool_input_str.trim())}catch{l.value="Tool input must be valid JSON";return}i.value=!0;try{await q.post("/api/schedules",B),Ee.success("Schedule created"),a.value={description:"",action:"reminder",channel_id:"",cron:"",run_at:"",message:"",tool_name:"",tool_input_str:"",report_format:""},u.value=null,n.value=!1,await I()}catch(ie){l.value=ie.message}i.value=!1}async function we(W){b.value=W;try{const B=await q.post(`/api/schedules/${encodeURIComponent(W)}/run`);if(B.status==="failure")Ee.error(`Execution failed: ${B.error||"unknown error"}`);else{const ie=B.warning?`Executed (${B.warning})`:"Executed successfully";Ee.success(ie)}await I()}catch(B){Ee.error(B.message||"Failed to trigger")}b.value=null}async function re(W){E.value=W.id;const B=!W.paused;try{await q.put(`/api/schedules/${encodeURIComponent(W.id)}`,{paused:B}),Ee.success(B?"Schedule paused":"Schedule resumed"),await I()}catch(ie){Ee.error(ie.message||"Failed to update schedule")}E.value=null}async function he(W,B){x.value=W.id;try{await q.put(`/api/schedules/${encodeURIComponent(W.id)}`,{report_format:B}),Ee.success(B?"Structured report enabled":"Plain-text report enabled")}catch(ie){Ee.error(`Update failed: ${ie.message}`)}finally{await I(),x.value=null}}async function se(W){O.value=W;try{await q.post(`/api/schedules/${encodeURIComponent(W)}/reset-failures`),Ee.success("Failure counters reset"),await I()}catch(B){Ee.error(B.message||"Failed to reset")}O.value=null}async function me(W){const B=e.value.find(le=>le.id===W);if(await _s({title:"Delete schedule",message:`Delete "${(B==null?void 0:B.description)||W}"? This cannot be undone.`,confirmLabel:"Delete",danger:!0})){y.value=W;try{await q.del(`/api/schedules/${encodeURIComponent(W)}`),Ee.success("Schedule deleted"),await I()}catch(le){Ee.error(le.message||"Failed to delete schedule")}y.value=null}}return We(()=>{I()}),{schedules:e,loading:t,error:s,showCreate:n,form:a,creating:i,createError:l,runAtUtcPreview:d,runAtAnalysis:o,runAtOccurrence:r,cronResult:u,validatingCron:p,cronPresets:f,runningId:b,deletingId:y,togglingId:E,resettingId:O,reportUpdatingId:x,expandedId:m,history:_,historyLoading:S,historyError:g,cronCount:T,oneTimeCount:C,webhookCount:M,pausedCount:H,failingCount:P,formatTs:fa,formatAge:mm,formatFuture:R,formatMs:V,formatDuration:Xa,onCronInput:Q,onRunAtInput:U,validateCron:N,toggleExpand:Y,fetchSchedules:I,doCreate:Se,doRunNow:we,doTogglePause:re,doUpdateReportFormat:he,doResetFailures:se,doDelete:me}}},_m=[{id:"live",label:"Live",component:Q_},{id:"agents",label:"Agents",component:nk},{id:"loops",label:"Loops",component:ak},{id:"processes",label:"Processes",component:ik},{id:"schedules",label:"Schedules",component:dk}],uk={components:{TabbedPage:Mr},setup(){return{tabs:_m}},template:''},pk={template:`

Audit Log

@@ -1243,7 +1266,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(null),a=h({tool:"",user:"",keyword:"",date:"",limit:50});function i(c){if(!c)return"";if(typeof c=="string")return c;try{return JSON.stringify(c,null,2)}catch{return String(c)}}function l(c){n.value=n.value===c?null:c}function r(){a.value={tool:"",user:"",keyword:"",date:"",limit:50},o()}async function o(){t.value=!0,s.value=null,n.value=null;try{const c=new URLSearchParams;a.value.tool&&c.set("tool",a.value.tool),a.value.user&&c.set("user",a.value.user),a.value.keyword&&c.set("q",a.value.keyword),a.value.date&&c.set("date",a.value.date),c.set("limit",String(a.value.limit));const d=c.toString(),u=await G.get(`/api/audit${d?"?"+d:""}`);e.value=Array.isArray(u)?u:[]}catch(c){s.value=c.message}t.value=!1}return We(()=>{o()}),{entries:e,loading:t,error:s,expandedIdx:n,filters:a,formatTs:pa,formatDetail:i,truncateBlock:gm,toggleExpand:l,clearFilters:r,fetchAudit:o}}},Du=[{id:"all",name:"All Sessions",icon:"list",filters:{}},{id:"active",name:"Recently Active",icon:"activity",filters:{minAge:0,maxAge:3600}},{id:"discord",name:"Discord Only",icon:"message",filters:{source:"discord"}},{id:"web",name:"Web Only",icon:"globe",filters:{source:"web"}},{id:"long",name:"Long Conversations",icon:"book",filters:{minMessages:10}},{id:"compacted",name:"Compacted",icon:"archive",filters:{hasCompaction:!0}}],pk=[{value:"last_active",label:"Last Active"},{value:"created_at",label:"Created"},{value:"message_count",label:"Message Count"}],hk={template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(null),a=h({tool:"",user:"",keyword:"",date:"",limit:50});function i(c){if(!c)return"";if(typeof c=="string")return c;try{return JSON.stringify(c,null,2)}catch{return String(c)}}function l(c){n.value=n.value===c?null:c}function r(){a.value={tool:"",user:"",keyword:"",date:"",limit:50},o()}async function o(){t.value=!0,s.value=null,n.value=null;try{const c=new URLSearchParams;a.value.tool&&c.set("tool",a.value.tool),a.value.user&&c.set("user",a.value.user),a.value.keyword&&c.set("q",a.value.keyword),a.value.date&&c.set("date",a.value.date),c.set("limit",String(a.value.limit));const d=c.toString(),u=await q.get(`/api/audit${d?"?"+d:""}`);e.value=Array.isArray(u)?u:[]}catch(c){s.value=c.message}t.value=!1}return We(()=>{o()}),{entries:e,loading:t,error:s,expandedIdx:n,filters:a,formatTs:fa,formatDetail:i,truncateBlock:gm,toggleExpand:l,clearFilters:r,fetchAudit:o}}},Du=[{id:"all",name:"All Sessions",icon:"list",filters:{}},{id:"active",name:"Recently Active",icon:"activity",filters:{minAge:0,maxAge:3600}},{id:"discord",name:"Discord Only",icon:"message",filters:{source:"discord"}},{id:"web",name:"Web Only",icon:"globe",filters:{source:"web"}},{id:"long",name:"Long Conversations",icon:"book",filters:{minMessages:10}},{id:"compacted",name:"Compacted",icon:"archive",filters:{hasCompaction:!0}}],fk=[{value:"last_active",label:"Last Active"},{value:"created_at",label:"Created"},{value:"message_count",label:"Message Count"}],hk={template:`
@@ -1572,8 +1595,8 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(null),a=h(null),i=h(!1);let l=0;const r=h(null),o=h(!1),c=h(new Set),d=h(!1),u=h("all"),f=h(""),p=h("last_active"),b=h(!1),y=Du,E=pk,I=h([]),x=h(!1),m=h(""),_=h("flat"),S=h(new Set),g=h(""),w=h(""),T=h(""),C=h(null),M=h(!1);function H(){try{const K=localStorage.getItem("odin-session-presets");K&&(I.value=JSON.parse(K))}catch{}}function P(){try{localStorage.setItem("odin-session-presets",JSON.stringify(I.value))}catch{}}const R=J(()=>f.value.trim()!==""||u.value!=="all"),j=J(()=>{let K=[...e.value];const xe=Du.find(Pe=>Pe.id===u.value),Ce=xe?xe.filters:{};if(Ce.source&&(K=K.filter(Pe=>Pe.source===Ce.source)),Ce.minMessages&&(K=K.filter(Pe=>Pe.message_count>=Ce.minMessages)),Ce.hasCompaction&&(K=K.filter(Pe=>Pe.has_summary)),Ce.maxAge!=null){const Pe=Date.now()/1e3;K=K.filter(pt=>pt.last_active&&Pe-pt.last_active<=Ce.maxAge)}if(f.value.trim()){const Pe=f.value.toLowerCase().trim();K=K.filter(pt=>(pt.channel_id||"").toLowerCase().includes(Pe)||(pt.last_user_id||"").toLowerCase().includes(Pe)||(pt.source||"").toLowerCase().includes(Pe))}const Re=p.value,Ve=b.value?1:-1;return K.sort((Pe,pt)=>{const ls=Pe[Re]||0,Ps=pt[Re]||0;return(ls-Ps)*Ve}),K}),Q=J(()=>{if(!a.value||!a.value.messages)return[];const K=a.value.messages;if(K.length===0)return[];const xe=[];let Ce=[];for(const Re of K)Re.role==="user"&&Ce.length>0&&(xe.push(Ce),Ce=[]),Ce.push(Re);return Ce.length>0&&xe.push(Ce),xe}),U=J(()=>j.value.length>0&&c.value.size===j.value.length);function O(K){const xe=K.find(Ce=>Ce.role==="user");if(xe&&xe.content){const Ce=xe.content.slice(0,120);return Ce.lengthxe.id!==K),P(),u.value===K&&(u.value="all")}function he(){u.value="all",f.value="",p.value="last_active",b.value=!1}function F(K){if(!K)return"—";const xe=Date.now()/1e3-K;if(xe<60)return"just now";if(xe<3600){const Re=Math.floor(xe/60);return`${Re} minute${Re!==1?"s":""} ago`}if(xe<86400){const Re=Math.floor(xe/3600);return`${Re} hour${Re!==1?"s":""} ago`}const Ce=Math.floor(xe/86400);return`${Ce} day${Ce!==1?"s":""} ago`}function se(K){if(!K)return"";try{return new Date(K*1e3).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}}function Se(K){if(!K)return"";try{return new Date(K*1e3).toLocaleString()}catch{return""}}function V(K){return K==="user"?"bg-gray-900/50 border border-gray-800":K==="assistant"?"bg-indigo-950/30 border border-indigo-900/30":"bg-gray-900/30 border border-gray-800/50"}function de(K){return K==="user"?"sess-msg-user":K==="assistant"?"sess-msg-assistant":"sess-msg-system"}function ce(K){return K==="user"?"badge-info":K==="assistant"?"badge-success":"badge-warning"}function ye(K){return K==="user"?"sess-dot-user":K==="assistant"?"sess-dot-assistant":"sess-dot-system"}function ge(K){return K==="user"?"text-cyan-400":K==="assistant"?"text-indigo-400":"text-gray-500"}function He(K){return K?K.length>2e3?K.slice(0,2e3)+` -... (truncated)`:K:""}async function k(){const K=g.value.trim();if(K){M.value=!0;try{let xe=`/api/sessions/search?q=${encodeURIComponent(K)}&limit=50`;w.value.trim()&&(xe+=`&channel_id=${encodeURIComponent(w.value.trim())}`),T.value.trim()&&(xe+=`&user_id=${encodeURIComponent(T.value.trim())}`);const Ce=await G.get(xe);C.value=Ce.results||[]}catch{C.value=[]}M.value=!1}}function L(){g.value="",w.value="",T.value="",C.value=null}function $(K){return K?K.replace(/&/g,"&").replace(//g,">").replace(/>>>/g,'').replace(/<<</g,""):""}function ee(K){return K==="user"?"fts-result-user":K==="assistant"?"fts-result-assistant":K==="summary"?"fts-result-summary":K==="fts"?"fts-result-fts":K==="channel"?"fts-result-channel":"fts-result-default"}function Z(K){return K==="user"?"badge-info":K==="assistant"?"badge-success":K==="summary"?"badge-warning":K==="fts"?"badge-success":"badge-info"}async function X(){t.value=!0,s.value=null;try{e.value=await G.get("/api/sessions")}catch(K){s.value=K.message}t.value=!1}function ue(){s.value=null,X()}async function oe(K){if(n.value===K){n.value=null,a.value=null,S.value=new Set;return}n.value=K,a.value=null,i.value=!0,S.value=new Set;const xe=++l;try{const Ce=await G.get(`/api/sessions/${encodeURIComponent(K)}`);xe===l&&n.value===K&&(a.value=Ce)}catch(Ce){xe===l&&n.value===K&&(a.value={messages:[],summary:"",error:Ce.message||"Failed to load session"})}finally{xe===l&&(i.value=!1)}}function le(K){const xe=new Set(c.value);xe.has(K)?xe.delete(K):xe.add(K),c.value=xe}function te(){U.value?c.value=new Set:c.value=new Set(j.value.map(K=>K.channel_id))}function ne(K){r.value=K}async function fe(){if(r.value){o.value=!0;try{await G.del(`/api/sessions/${encodeURIComponent(r.value)}`),n.value===r.value&&(n.value=null,a.value=null),c.value.delete(r.value),await X()}catch(K){s.value=K.message||"Failed to clear session"}o.value=!1,r.value=null}}function ve(){d.value=!0}async function Te(){if(c.value.size!==0){o.value=!0;try{await G.post("/api/sessions/clear-bulk",{channel_ids:[...c.value]}),c.value.has(n.value)&&(n.value=null,a.value=null),c.value=new Set,await X()}catch(K){s.value=K.message||"Failed to clear sessions"}o.value=!1,d.value=!1}}async function Oe(K,xe){const Ce=`/api/sessions/${encodeURIComponent(K)}/export?format=${xe}`;try{const Re=await G.getBlob(Ce),Ve=URL.createObjectURL(Re),Pe=document.createElement("a");Pe.href=Ve,Pe.download=`session-${K}.${xe==="text"?"txt":"json"}`,Pe.click(),URL.revokeObjectURL(Ve)}catch(Re){s.value=Re.message||"Failed to export session"}}let Le=null;function De(K){K.payload&&K.payload.channel_id&&(clearTimeout(Le),Le=setTimeout(()=>{if(X(),n.value&&K.payload.channel_id===n.value){const xe=n.value,Ce=l;G.get(`/api/sessions/${encodeURIComponent(xe)}`).then(Re=>{Ce!==l||n.value!==xe||(a.value=Re)}).catch(()=>{})}},2e3))}let Be=!1;function qe(){Be||(Be=!0,X(),Ke.subscribe("events",De))}We(()=>{H(),qe()}),Ds(()=>{qe()});function ct(){Be&&(Be=!1,Ke.unsubscribe("events",De),clearTimeout(Le))}return Ms(ct),xt(ct),{sessions:e,loading:t,error:s,expandedId:n,detail:a,detailLoading:i,clearTarget:r,clearing:o,selected:c,allSelected:U,bulkClearing:d,activePreset:u,searchQuery:f,sortBy:p,sortAsc:b,filterPresets:y,sortOptions:E,filteredSessions:j,hasActiveFilters:R,customPresets:I,showSavePreset:x,newPresetName:m,threadView:_,threads:Q,collapsedThreads:S,ftsQuery:g,ftsChannelId:w,ftsUserId:T,ftsResults:C,ftsSearching:M,formatAge:F,formatTimestamp:se,formatFullTimestamp:Se,messageClass:V,threadMsgClass:de,roleBadge:ce,roleDotClass:ye,roleLabelClass:ge,truncateContent:He,threadSummary:O,fetchSessions:X,retry:ue,toggleSession:oe,toggleSelect:le,toggleSelectAll:te,confirmClear:ne,clearSession:fe,confirmBulkClear:ve,doBulkClear:Te,exportSession:Oe,applyPreset:Y,applyCustomPreset:we,saveCustomPreset:ke,removeCustomPreset:ie,resetFilters:he,toggleThread:N,runFtsSearch:k,clearFtsSearch:L,highlightSnippet:$,ftsResultClass:ee,ftsTypeBadge:Z}}},mk={props:["trace"],template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(null),a=h(null),i=h(!1);let l=0;const r=h(null),o=h(!1),c=h(new Set),d=h(!1),u=h("all"),p=h(""),f=h("last_active"),b=h(!1),y=Du,E=fk,O=h([]),x=h(!1),m=h(""),_=h("flat"),S=h(new Set),g=h(""),w=h(""),T=h(""),C=h(null),M=h(!1);function H(){try{const G=localStorage.getItem("odin-session-presets");G&&(O.value=JSON.parse(G))}catch{}}function P(){try{localStorage.setItem("odin-session-presets",JSON.stringify(O.value))}catch{}}const R=J(()=>p.value.trim()!==""||u.value!=="all"),V=J(()=>{let G=[...e.value];const _e=Du.find(Pe=>Pe.id===u.value),Ce=_e?_e.filters:{};if(Ce.source&&(G=G.filter(Pe=>Pe.source===Ce.source)),Ce.minMessages&&(G=G.filter(Pe=>Pe.message_count>=Ce.minMessages)),Ce.hasCompaction&&(G=G.filter(Pe=>Pe.has_summary)),Ce.maxAge!=null){const Pe=Date.now()/1e3;G=G.filter(ft=>ft.last_active&&Pe-ft.last_active<=Ce.maxAge)}if(p.value.trim()){const Pe=p.value.toLowerCase().trim();G=G.filter(ft=>(ft.channel_id||"").toLowerCase().includes(Pe)||(ft.last_user_id||"").toLowerCase().includes(Pe)||(ft.source||"").toLowerCase().includes(Pe))}const Re=f.value,Ve=b.value?1:-1;return G.sort((Pe,ft)=>{const ls=Pe[Re]||0,Ps=ft[Re]||0;return(ls-Ps)*Ve}),G}),Q=J(()=>{if(!a.value||!a.value.messages)return[];const G=a.value.messages;if(G.length===0)return[];const _e=[];let Ce=[];for(const Re of G)Re.role==="user"&&Ce.length>0&&(_e.push(Ce),Ce=[]),Ce.push(Re);return Ce.length>0&&_e.push(Ce),_e}),U=J(()=>V.value.length>0&&c.value.size===V.value.length);function N(G){const _e=G.find(Ce=>Ce.role==="user");if(_e&&_e.content){const Ce=_e.content.slice(0,120);return Ce.length<_e.content.length?Ce+"...":Ce}return"(no user message)"}function I(G){const _e=new Set(S.value);_e.has(G)?_e.delete(G):_e.add(G),S.value=_e}function Y(G){u.value=G}function Se(G){u.value=G.id,G.filters.searchQuery!=null&&(p.value=G.filters.searchQuery),G.filters.sortBy&&(f.value=G.filters.sortBy)}function we(){if(!m.value.trim())return;const G={id:"custom-"+Date.now(),name:m.value.trim(),filters:{searchQuery:p.value,sortBy:f.value}};O.value=[...O.value,G],P(),x.value=!1,m.value=""}function re(G){O.value=O.value.filter(_e=>_e.id!==G),P(),u.value===G&&(u.value="all")}function he(){u.value="all",p.value="",f.value="last_active",b.value=!1}function se(G){if(!G)return"—";const _e=Date.now()/1e3-G;if(_e<60)return"just now";if(_e<3600){const Re=Math.floor(_e/60);return`${Re} minute${Re!==1?"s":""} ago`}if(_e<86400){const Re=Math.floor(_e/3600);return`${Re} hour${Re!==1?"s":""} ago`}const Ce=Math.floor(_e/86400);return`${Ce} day${Ce!==1?"s":""} ago`}function me(G){if(!G)return"";try{return new Date(G*1e3).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}}function W(G){if(!G)return"";try{return new Date(G*1e3).toLocaleString()}catch{return""}}function B(G){return G==="user"?"bg-gray-900/50 border border-gray-800":G==="assistant"?"bg-indigo-950/30 border border-indigo-900/30":"bg-gray-900/30 border border-gray-800/50"}function ie(G){return G==="user"?"sess-msg-user":G==="assistant"?"sess-msg-assistant":"sess-msg-system"}function le(G){return G==="user"?"badge-info":G==="assistant"?"badge-success":"badge-warning"}function xe(G){return G==="user"?"sess-dot-user":G==="assistant"?"sess-dot-assistant":"sess-dot-system"}function ge(G){return G==="user"?"text-cyan-400":G==="assistant"?"text-indigo-400":"text-gray-500"}function Fe(G){return G?G.length>2e3?G.slice(0,2e3)+` +... (truncated)`:G:""}async function k(){const G=g.value.trim();if(G){M.value=!0;try{let _e=`/api/sessions/search?q=${encodeURIComponent(G)}&limit=50`;w.value.trim()&&(_e+=`&channel_id=${encodeURIComponent(w.value.trim())}`),T.value.trim()&&(_e+=`&user_id=${encodeURIComponent(T.value.trim())}`);const Ce=await q.get(_e);C.value=Ce.results||[]}catch{C.value=[]}M.value=!1}}function L(){g.value="",w.value="",T.value="",C.value=null}function F(G){return G?G.replace(/&/g,"&").replace(//g,">").replace(/>>>/g,'').replace(/<<</g,""):""}function ee(G){return G==="user"?"fts-result-user":G==="assistant"?"fts-result-assistant":G==="summary"?"fts-result-summary":G==="fts"?"fts-result-fts":G==="channel"?"fts-result-channel":"fts-result-default"}function Z(G){return G==="user"?"badge-info":G==="assistant"?"badge-success":G==="summary"?"badge-warning":G==="fts"?"badge-success":"badge-info"}async function X(){t.value=!0,s.value=null;try{e.value=await q.get("/api/sessions")}catch(G){s.value=G.message}t.value=!1}function ue(){s.value=null,X()}async function de(G){if(n.value===G){n.value=null,a.value=null,S.value=new Set;return}n.value=G,a.value=null,i.value=!0,S.value=new Set;const _e=++l;try{const Ce=await q.get(`/api/sessions/${encodeURIComponent(G)}`);_e===l&&n.value===G&&(a.value=Ce)}catch(Ce){_e===l&&n.value===G&&(a.value={messages:[],summary:"",error:Ce.message||"Failed to load session"})}finally{_e===l&&(i.value=!1)}}function oe(G){const _e=new Set(c.value);_e.has(G)?_e.delete(G):_e.add(G),c.value=_e}function te(){U.value?c.value=new Set:c.value=new Set(V.value.map(G=>G.channel_id))}function ne(G){r.value=G}async function pe(){if(r.value){o.value=!0;try{await q.del(`/api/sessions/${encodeURIComponent(r.value)}`),n.value===r.value&&(n.value=null,a.value=null),c.value.delete(r.value),await X()}catch(G){s.value=G.message||"Failed to clear session"}o.value=!1,r.value=null}}function be(){d.value=!0}async function Te(){if(c.value.size!==0){o.value=!0;try{await q.post("/api/sessions/clear-bulk",{channel_ids:[...c.value]}),c.value.has(n.value)&&(n.value=null,a.value=null),c.value=new Set,await X()}catch(G){s.value=G.message||"Failed to clear sessions"}o.value=!1,d.value=!1}}async function Oe(G,_e){const Ce=`/api/sessions/${encodeURIComponent(G)}/export?format=${_e}`;try{const Re=await q.getBlob(Ce),Ve=URL.createObjectURL(Re),Pe=document.createElement("a");Pe.href=Ve,Pe.download=`session-${G}.${_e==="text"?"txt":"json"}`,Pe.click(),URL.revokeObjectURL(Ve)}catch(Re){s.value=Re.message||"Failed to export session"}}let Le=null;function De(G){G.payload&&G.payload.channel_id&&(clearTimeout(Le),Le=setTimeout(()=>{if(X(),n.value&&G.payload.channel_id===n.value){const _e=n.value,Ce=l;q.get(`/api/sessions/${encodeURIComponent(_e)}`).then(Re=>{Ce!==l||n.value!==_e||(a.value=Re)}).catch(()=>{})}},2e3))}let Be=!1;function qe(){Be||(Be=!0,X(),Ke.subscribe("events",De))}We(()=>{H(),qe()}),Ds(()=>{qe()});function ct(){Be&&(Be=!1,Ke.unsubscribe("events",De),clearTimeout(Le))}return Ms(ct),xt(ct),{sessions:e,loading:t,error:s,expandedId:n,detail:a,detailLoading:i,clearTarget:r,clearing:o,selected:c,allSelected:U,bulkClearing:d,activePreset:u,searchQuery:p,sortBy:f,sortAsc:b,filterPresets:y,sortOptions:E,filteredSessions:V,hasActiveFilters:R,customPresets:O,showSavePreset:x,newPresetName:m,threadView:_,threads:Q,collapsedThreads:S,ftsQuery:g,ftsChannelId:w,ftsUserId:T,ftsResults:C,ftsSearching:M,formatAge:se,formatTimestamp:me,formatFullTimestamp:W,messageClass:B,threadMsgClass:ie,roleBadge:le,roleDotClass:xe,roleLabelClass:ge,truncateContent:Fe,threadSummary:N,fetchSessions:X,retry:ue,toggleSession:de,toggleSelect:oe,toggleSelectAll:te,confirmClear:ne,clearSession:pe,confirmBulkClear:be,doBulkClear:Te,exportSession:Oe,applyPreset:Y,applyCustomPreset:Se,saveCustomPreset:we,removeCustomPreset:re,resetFilters:he,toggleThread:I,runFtsSearch:k,clearFtsSearch:L,highlightSnippet:F,ftsResultClass:ee,ftsTypeBadge:Z}}},mk={props:["trace"],template:`
Context Assembly
@@ -2013,7 +2036,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h([]),s=h(!0),n=h(null),a=h(null),i=h(null),l=h(""),r=h(""),o=h(0),c=h({}),d=h({channel_id:"",user_id:"",tool_name:"",errors_only:!1,limit:50});function u(w){if(!w)return"—";try{const T=new Date(w);return isNaN(T.getTime())?w:T.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return w}}function f(w){return!w&&w!==0?"—":w<1e3?w+"ms":(w/1e3).toFixed(1)+"s"}function p(w){return!w&&w!==0?"—":w>=1e3?(w/1e3).toFixed(1)+"k":String(w)}function b(w){if(!w)return"";if(typeof w=="string")return w;try{return JSON.stringify(w,null,2)}catch{return String(w)}}function y(w){a.value===w?a.value=null:(a.value=w,c.value={})}function E(w,T){const C=w+"-"+T;c.value={...c.value,[C]:!c.value[C]}}function I(w,T){return!!c.value[w+"-"+T]}function x(){d.value={channel_id:"",user_id:"",tool_name:"",errors_only:!1,limit:50},r.value="",l.value="",i.value=null,S()}async function m(){try{const w=await G.get("/api/trajectories");e.value=w.files||[],o.value=w.count||0}catch{}}let _=0;async function S(){const w=++_;s.value=!0,n.value=null,a.value=null,i.value=null,c.value={};try{if(r.value){const T=await G.get(`/api/trajectories/${encodeURIComponent(r.value)}?limit=${d.value.limit}`);if(w!==_)return;let C=T.entries||[];d.value.tool_name&&(C=C.filter(M=>(M.tools_used||[]).includes(d.value.tool_name))),d.value.errors_only&&(C=C.filter(M=>M.is_error)),d.value.channel_id&&(C=C.filter(M=>M.channel_id===d.value.channel_id)),d.value.user_id&&(C=C.filter(M=>M.user_id===d.value.user_id)),t.value=C}else{const T=new URLSearchParams;d.value.channel_id&&T.set("channel_id",d.value.channel_id),d.value.user_id&&T.set("user_id",d.value.user_id),d.value.tool_name&&T.set("tool_name",d.value.tool_name),d.value.errors_only&&T.set("errors_only","true"),T.set("limit",String(d.value.limit));const C=T.toString(),M=await G.get(`/api/trajectories/search/query?${C}`);if(w!==_)return;t.value=M.results||[]}}catch(T){if(w!==_)return;n.value=T.message}w===_&&(s.value=!1)}async function g(){if(!l.value.trim())return;const w=++_;s.value=!0,n.value=null,c.value={};try{const T=await G.get(`/api/trajectories/message/${encodeURIComponent(l.value.trim())}`);if(w!==_)return;i.value=T.entry||null,i.value||(n.value="No trace found for this message ID")}catch(T){if(w!==_)return;T.status===404?(i.value=null,n.value="No trace found for message ID: "+l.value):n.value=T.message}w===_&&(s.value=!1)}return We(async()=>{await m(),await S()}),{files:e,entries:t,loading:s,error:n,expandedIdx:a,singleTrace:i,messageIdQuery:l,selectedFile:r,totalSaved:o,filters:d,expandedIterations:c,formatTs:u,formatDuration:f,formatTokens:p,formatJSON:b,truncateBlock:gm,toggleExpand:y,toggleIteration:E,isIterationExpanded:I,clearFilters:x,fetchFiles:m,fetchTraces:S,lookupMessage:g}}},vk={template:` + `,setup(){const e=h([]),t=h([]),s=h(!0),n=h(null),a=h(null),i=h(null),l=h(""),r=h(""),o=h(0),c=h({}),d=h({channel_id:"",user_id:"",tool_name:"",errors_only:!1,limit:50});function u(w){if(!w)return"—";try{const T=new Date(w);return isNaN(T.getTime())?w:T.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return w}}function p(w){return!w&&w!==0?"—":w<1e3?w+"ms":(w/1e3).toFixed(1)+"s"}function f(w){return!w&&w!==0?"—":w>=1e3?(w/1e3).toFixed(1)+"k":String(w)}function b(w){if(!w)return"";if(typeof w=="string")return w;try{return JSON.stringify(w,null,2)}catch{return String(w)}}function y(w){a.value===w?a.value=null:(a.value=w,c.value={})}function E(w,T){const C=w+"-"+T;c.value={...c.value,[C]:!c.value[C]}}function O(w,T){return!!c.value[w+"-"+T]}function x(){d.value={channel_id:"",user_id:"",tool_name:"",errors_only:!1,limit:50},r.value="",l.value="",i.value=null,S()}async function m(){try{const w=await q.get("/api/trajectories");e.value=w.files||[],o.value=w.count||0}catch{}}let _=0;async function S(){const w=++_;s.value=!0,n.value=null,a.value=null,i.value=null,c.value={};try{if(r.value){const T=await q.get(`/api/trajectories/${encodeURIComponent(r.value)}?limit=${d.value.limit}`);if(w!==_)return;let C=T.entries||[];d.value.tool_name&&(C=C.filter(M=>(M.tools_used||[]).includes(d.value.tool_name))),d.value.errors_only&&(C=C.filter(M=>M.is_error)),d.value.channel_id&&(C=C.filter(M=>M.channel_id===d.value.channel_id)),d.value.user_id&&(C=C.filter(M=>M.user_id===d.value.user_id)),t.value=C}else{const T=new URLSearchParams;d.value.channel_id&&T.set("channel_id",d.value.channel_id),d.value.user_id&&T.set("user_id",d.value.user_id),d.value.tool_name&&T.set("tool_name",d.value.tool_name),d.value.errors_only&&T.set("errors_only","true"),T.set("limit",String(d.value.limit));const C=T.toString(),M=await q.get(`/api/trajectories/search/query?${C}`);if(w!==_)return;t.value=M.results||[]}}catch(T){if(w!==_)return;n.value=T.message}w===_&&(s.value=!1)}async function g(){if(!l.value.trim())return;const w=++_;s.value=!0,n.value=null,c.value={};try{const T=await q.get(`/api/trajectories/message/${encodeURIComponent(l.value.trim())}`);if(w!==_)return;i.value=T.entry||null,i.value||(n.value="No trace found for this message ID")}catch(T){if(w!==_)return;T.status===404?(i.value=null,n.value="No trace found for message ID: "+l.value):n.value=T.message}w===_&&(s.value=!1)}return We(async()=>{await m(),await S()}),{files:e,entries:t,loading:s,error:n,expandedIdx:a,singleTrace:i,messageIdQuery:l,selectedFile:r,totalSaved:o,filters:d,expandedIterations:c,formatTs:u,formatDuration:p,formatTokens:f,formatJSON:b,truncateBlock:gm,toggleExpand:y,toggleIteration:E,isIterationExpanded:O,clearFilters:x,fetchFiles:m,fetchTraces:S,lookupMessage:g}}},vk={template:`
@@ -2178,7 +2201,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(!0),t=h(null),s=h(!1),n=h({by_user:{},by_channel:{},by_tool:{},recent:[],pricing:{}}),a=h({requests:0,input_tokens:0,output_tokens:0,total_tokens:0,cost_usd:0}),i=h("user");let l=null;const r=[{key:"user",label:"By User"},{key:"channel",label:"By Channel"},{key:"tool",label:"By Tool"},{key:"recent",label:"Recent"}],o=J(()=>[...n.value.recent||[]].reverse()),c=async()=>{try{const b=await G.get("/api/usage");n.value=b,a.value=b.totals||a.value,t.value=null,s.value=!0}catch(b){t.value=b.message}finally{e.value=!1}},d=()=>{e.value=!0,c()};let u=!1;function f(){u||(u=!0,c(),l||(l=setInterval(c,15e3)))}function p(){u&&(u=!1,l&&(clearInterval(l),l=null))}return We(f),Ds(f),Ms(p),xt(p),{hasData:s,loading:e,error:t,data:n,totals:a,activeTab:i,tabs:r,recentReversed:o,fmtNum:vm,formatTime:hm,retry:d}}},km=[{id:"audit",label:"Audit",component:fk},{id:"sessions",label:"Sessions",component:hk},{id:"traces",label:"Traces",component:gk},{id:"usage",label:"Usage",component:vk}],bk={components:{TabbedPage:Mr},setup(){return{tabs:km}},template:''},no=[{id:"system",label:"System & Commands",icon:"terminal",match:e=>/^(run_command|run_script|read_file|write_file|list_directory|search_files|manage_process|file_|post_file)/.test(e)},{id:"devops",label:"DevOps & Infrastructure",icon:"server",match:e=>/^(git_ops|docker_ops|kubectl|terraform_ops|http_probe)/.test(e)},{id:"agents",label:"Agents & Orchestration",icon:"bot",match:e=>/^(spawn_agent|send_to_agent|wait_for_agents|get_agent_results|kill_agent|list_agents|spawn_loop_agents|collect_loop_agents)/.test(e)},{id:"workflow",label:"Workflows & Tasks",icon:"workflow",match:e=>/^(delegate_task|cancel_task|list_tasks|schedule_|start_loop|stop_loop|list_loops|delete_schedule|list_schedules|update_schedule|parse_time)/.test(e)},{id:"network",label:"Network & Web",icon:"globe",match:e=>/^(web_|browser_|search_web|fetch_url|http_)/.test(e)},{id:"knowledge",label:"Knowledge & Search",icon:"book",match:e=>/^(search_knowledge|ingest_|knowledge_|search_history|search_audit|bulk_ingest|delete_knowledge|list_knowledge)/.test(e)},{id:"discord",label:"Discord & Admin",icon:"message",match:e=>/^(send_|add_reaction|create_poll|purge_|discord_|embed_|read_channel|set_permission)/.test(e)},{id:"skills",label:"Skills",icon:"puzzle",match:e=>/^(create_skill|edit_skill|delete_skill|enable_skill|disable_skill|install_skill|export_skill|skill_status|invoke_skill|list_skills)/.test(e)},{id:"memory",label:"Memory & State",icon:"brain",match:e=>/^(memory_manage|list_manage)/.test(e)},{id:"ai",label:"AI & Generation",icon:"sparkles",match:e=>/^(generate_|analyze_|claude_|vision_|comfyui_)/.test(e)},{id:"integrations",label:"Integrations",icon:"link",match:e=>/^(issue_tracker|slack_|grafana_|mcp_)/.test(e)},{id:"other",label:"Other Tools",icon:"wrench",match:()=>!0}],yk={template:` + `,setup(){const e=h(!0),t=h(null),s=h(!1),n=h({by_user:{},by_channel:{},by_tool:{},recent:[],pricing:{}}),a=h({requests:0,input_tokens:0,output_tokens:0,total_tokens:0,cost_usd:0}),i=h("user");let l=null;const r=[{key:"user",label:"By User"},{key:"channel",label:"By Channel"},{key:"tool",label:"By Tool"},{key:"recent",label:"Recent"}],o=J(()=>[...n.value.recent||[]].reverse()),c=async()=>{try{const b=await q.get("/api/usage");n.value=b,a.value=b.totals||a.value,t.value=null,s.value=!0}catch(b){t.value=b.message}finally{e.value=!1}},d=()=>{e.value=!0,c()};let u=!1;function p(){u||(u=!0,c(),l||(l=setInterval(c,15e3)))}function f(){u&&(u=!1,l&&(clearInterval(l),l=null))}return We(p),Ds(p),Ms(f),xt(f),{hasData:s,loading:e,error:t,data:n,totals:a,activeTab:i,tabs:r,recentReversed:o,fmtNum:vm,formatTime:hm,retry:d}}},km=[{id:"audit",label:"Audit",component:pk},{id:"sessions",label:"Sessions",component:hk},{id:"traces",label:"Traces",component:gk},{id:"usage",label:"Usage",component:vk}],bk={components:{TabbedPage:Mr},setup(){return{tabs:km}},template:''},no=[{id:"system",label:"System & Commands",icon:"terminal",match:e=>/^(run_command|run_script|read_file|write_file|list_directory|search_files|manage_process|file_|post_file)/.test(e)},{id:"devops",label:"DevOps & Infrastructure",icon:"server",match:e=>/^(git_ops|docker_ops|kubectl|terraform_ops|http_probe)/.test(e)},{id:"agents",label:"Agents & Orchestration",icon:"bot",match:e=>/^(spawn_agent|send_to_agent|wait_for_agents|get_agent_results|kill_agent|list_agents|spawn_loop_agents|collect_loop_agents)/.test(e)},{id:"workflow",label:"Workflows & Tasks",icon:"workflow",match:e=>/^(delegate_task|cancel_task|list_tasks|schedule_|start_loop|stop_loop|list_loops|delete_schedule|list_schedules|update_schedule|parse_time)/.test(e)},{id:"network",label:"Network & Web",icon:"globe",match:e=>/^(web_|browser_|search_web|fetch_url|http_)/.test(e)},{id:"knowledge",label:"Knowledge & Search",icon:"book",match:e=>/^(search_knowledge|ingest_|knowledge_|search_history|search_audit|bulk_ingest|delete_knowledge|list_knowledge)/.test(e)},{id:"discord",label:"Discord & Admin",icon:"message",match:e=>/^(send_|add_reaction|create_poll|purge_|discord_|embed_|read_channel|set_permission)/.test(e)},{id:"skills",label:"Skills",icon:"puzzle",match:e=>/^(create_skill|edit_skill|delete_skill|enable_skill|disable_skill|install_skill|export_skill|skill_status|invoke_skill|list_skills)/.test(e)},{id:"memory",label:"Memory & State",icon:"brain",match:e=>/^(memory_manage|list_manage)/.test(e)},{id:"ai",label:"AI & Generation",icon:"sparkles",match:e=>/^(generate_|analyze_|claude_|vision_|comfyui_)/.test(e)},{id:"integrations",label:"Integrations",icon:"link",match:e=>/^(issue_tracker|slack_|grafana_|mcp_)/.test(e)},{id:"other",label:"Other Tools",icon:"wrench",match:()=>!0}],yk={template:`

Tools

@@ -2343,7 +2366,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config Try a different search term
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(""),a=h({}),i=h({}),l=h("cards"),r=h(null),o=J(()=>e.value.filter(x=>x.is_core).length),c=J(()=>e.value.filter(x=>!x.is_core).length),d=J(()=>Object.values(a.value).reduce((x,m)=>x+m,0));function u(x){for(const m of no)if(m.id!=="other"&&m.match(x))return m.id;return"other"}const f=J(()=>{let x=e.value;if(n.value){const m=n.value.toLowerCase();x=x.filter(_=>_.name.toLowerCase().includes(m)||(_.description||"").toLowerCase().includes(m))}return r.value&&(x=x.filter(m=>u(m.name)===r.value)),x}),p=J(()=>{const x=new Set;for(const m of e.value)x.add(u(m.name));return no.filter(m=>x.has(m.id))}),b=J(()=>{const x=f.value,m={};for(const S of x){const g=u(S.name);m[g]||(m[g]=[]),m[g].push(S)}const _=[];for(const S of no)m[S.id]&&m[S.id].length>0&&_.push({label:S.label,icon:S.icon,tools:m[S.id].sort((g,w)=>g.name.localeCompare(w.name))});return _});function y(x){i.value={...i.value,[x]:!i.value[x]}}async function E(){t.value=!0,s.value=null;try{const[x,m]=await Promise.all([G.get("/api/tools"),G.get("/api/tools/stats").catch(()=>({}))]);e.value=x,a.value=m||{};const _=Object.values(m||{}).filter(S=>S>0).sort((S,g)=>S-g)}catch(x){s.value=x.message}t.value=!1}function I(){E()}return We(()=>{E()}),{tools:e,loading:t,error:s,search:n,stats:a,expanded:i,viewMode:l,activeCategory:r,coreCount:o,skillCount:c,totalUsage:d,filteredTools:f,groupedTools:b,usedCategories:p,truncate:Zc,toggleExpand:y,refresh:I}}};function xk(e){if(!e)return"";let t=e.replace(/&/g,"&").replace(//g,">");t=t.replace(/("""[\s\S]*?"""|'''[\s\S]*?'''|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g,'$1'),t=t.replace(/(#[^\n]*)/g,'$1');const s="\\b(def|class|return|if|elif|else|for|while|import|from|as|try|except|finally|raise|with|async|await|yield|pass|break|continue|and|or|not|in|is|None|True|False|self|lambda)\\b";t=t.replace(new RegExp(s,"g"),'$1');const n="\\b(print|len|range|str|int|float|list|dict|set|tuple|type|isinstance|hasattr|getattr|setattr|super|property|staticmethod|classmethod|enumerate|zip|map|filter|sorted|reversed|any|all|min|max|sum|abs|round|open|format)\\b";return t=t.replace(new RegExp(n,"g"),'$1'),t=t.replace(/(@\w+)/g,'$1'),t=t.replace(/\b(\d+\.?\d*)\b/g,'$1'),t}function _k(e){if(!e)return"1";const t=e.split(` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(""),a=h({}),i=h({}),l=h("cards"),r=h(null),o=J(()=>e.value.filter(x=>x.is_core).length),c=J(()=>e.value.filter(x=>!x.is_core).length),d=J(()=>Object.values(a.value).reduce((x,m)=>x+m,0));function u(x){for(const m of no)if(m.id!=="other"&&m.match(x))return m.id;return"other"}const p=J(()=>{let x=e.value;if(n.value){const m=n.value.toLowerCase();x=x.filter(_=>_.name.toLowerCase().includes(m)||(_.description||"").toLowerCase().includes(m))}return r.value&&(x=x.filter(m=>u(m.name)===r.value)),x}),f=J(()=>{const x=new Set;for(const m of e.value)x.add(u(m.name));return no.filter(m=>x.has(m.id))}),b=J(()=>{const x=p.value,m={};for(const S of x){const g=u(S.name);m[g]||(m[g]=[]),m[g].push(S)}const _=[];for(const S of no)m[S.id]&&m[S.id].length>0&&_.push({label:S.label,icon:S.icon,tools:m[S.id].sort((g,w)=>g.name.localeCompare(w.name))});return _});function y(x){i.value={...i.value,[x]:!i.value[x]}}async function E(){t.value=!0,s.value=null;try{const[x,m]=await Promise.all([q.get("/api/tools"),q.get("/api/tools/stats").catch(()=>({}))]);e.value=x,a.value=m||{};const _=Object.values(m||{}).filter(S=>S>0).sort((S,g)=>S-g)}catch(x){s.value=x.message}t.value=!1}function O(){E()}return We(()=>{E()}),{tools:e,loading:t,error:s,search:n,stats:a,expanded:i,viewMode:l,activeCategory:r,coreCount:o,skillCount:c,totalUsage:d,filteredTools:p,groupedTools:b,usedCategories:f,truncate:Zc,toggleExpand:y,refresh:O}}};function xk(e){if(!e)return"";let t=e.replace(/&/g,"&").replace(//g,">");t=t.replace(/("""[\s\S]*?"""|'''[\s\S]*?'''|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g,'$1'),t=t.replace(/(#[^\n]*)/g,'$1');const s="\\b(def|class|return|if|elif|else|for|while|import|from|as|try|except|finally|raise|with|async|await|yield|pass|break|continue|and|or|not|in|is|None|True|False|self|lambda)\\b";t=t.replace(new RegExp(s,"g"),'$1');const n="\\b(print|len|range|str|int|float|list|dict|set|tuple|type|isinstance|hasattr|getattr|setattr|super|property|staticmethod|classmethod|enumerate|zip|map|filter|sorted|reversed|any|all|min|max|sum|abs|round|open|format)\\b";return t=t.replace(new RegExp(n,"g"),'$1'),t=t.replace(/(@\w+)/g,'$1'),t=t.replace(/\b(\d+\.?\d*)\b/g,'$1'),t}function _k(e){if(!e)return"1";const t=e.split(` `).length;return Array.from({length:t},(s,n)=>n+1).join(` `)}const kk={template:`
@@ -2545,10 +2568,10 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h({}),a=h({}),i=h(null),l=h(""),r=h(null),o=h(!1),c=h("create"),d=h(""),u=h(""),f=h(null),p=h(null),b=h(!1),y=h(null),E=h(null),I=h(!1),x=J(()=>e.value.length),m=J(()=>e.value.reduce((F,se)=>F+(se.execution_count||0),0)),_=J(()=>e.value.reduce((F,se)=>F+M(se.code),0)),S=J(()=>{if(!l.value)return e.value;const F=l.value.toLowerCase();return e.value.filter(se=>se.name.toLowerCase().includes(F)||(se.description||"").toLowerCase().includes(F))}),g=J(()=>u.value?u.value.split(` -`).length:0),w=J(()=>{const F=Math.max(g.value,1);return Array.from({length:F},(se,Se)=>Se+1).join(` -`)}),T=J(()=>{const F=u.value.trim();return F?F.includes("SKILL_DEFINITION")?F.includes("async def execute")?{valid:!0,message:""}:{valid:!1,message:"Missing async def execute function"}:{valid:!1,message:"Missing SKILL_DEFINITION dict"}:null});function C(F){return xk(F)}function M(F){return F?F.split(` -`).length:0}function H(F){return _k(F)}function P(F){n.value={...n.value,[F]:!n.value[F]}}async function R(F){try{await navigator.clipboard.writeText(F);const se=e.value.find(Se=>Se.code===F);se&&(r.value=se.name,setTimeout(()=>{r.value=null},2e3))}catch{}}function j(F){if(F.key==="Tab"){F.preventDefault();const se=F.target,Se=se.selectionStart,V=se.selectionEnd;u.value=u.value.substring(0,Se)+" "+u.value.substring(V),Rt(()=>{se.selectionStart=se.selectionEnd=Se+4})}}function Q(F){const se=F.target.previousElementSibling;se&&(se.scrollTop=F.target.scrollTop)}async function U(){t.value=!0,s.value=null;try{e.value=await G.get("/api/skills")}catch(F){s.value=F.message}t.value=!1}async function O(F){i.value=F,delete a.value[F],a.value={...a.value};try{const se=await G.post(`/api/skills/${encodeURIComponent(F)}/test`);a.value={...a.value,[F]:se}}catch(se){a.value={...a.value,[F]:{result:se.message,is_error:!0}}}i.value=null}function N(){o.value=!0,c.value="create",d.value="",u.value="",f.value=null,p.value=null}function Y(F){o.value=!0,c.value="edit",d.value=F.name,u.value=F.code||"",f.value=null,p.value=null}function we(){o.value=!1,f.value=null,p.value=null}async function ke(){f.value=null,p.value=null;const F=d.value.trim(),se=u.value.trim();if(!F){f.value="Name is required";return}if(!se){f.value="Code is required";return}b.value=!0;try{c.value==="create"?(await G.post("/api/skills",{name:F,code:se}),p.value="Skill created successfully"):(await G.put(`/api/skills/${encodeURIComponent(F)}`,{code:se}),p.value="Skill updated successfully"),await U(),setTimeout(()=>{o.value=!1},800)}catch(Se){f.value=Se.message}b.value=!1}function ie(F){E.value=F}async function he(){if(E.value){I.value=!0;try{await G.del(`/api/skills/${encodeURIComponent(E.value)}`),await U()}catch(F){Ae.error(`Failed to delete skill: ${F.message||"unknown error"}`)}I.value=!1,E.value=null}}return We(()=>{U()}),{skills:e,loading:t,error:s,showCode:n,testResults:a,testing:i,search:l,copied:r,editing:o,editMode:c,editName:d,editCode:u,editError:f,editSuccess:p,saving:b,editorRef:y,deleteTarget:E,deleting:I,enabledCount:x,totalExecutions:m,totalLines:_,displayedSkills:S,editLineCount:g,editorLineNums:w,editValidation:T,highlight:C,truncate:Zc,formatTs:pa,countLines:M,getLineNumbers:H,toggleCode:P,copyCode:R,handleEditorKey:j,syncScroll:Q,fetchSkills:U,testSkill:O,showCreate:N,editSkill:Y,cancelEdit:we,saveSkill:ke,confirmDelete:ie,doDelete:he}}};function wk(e,t){if(!e||!t)return Nu(e);const s=Nu(e),n=t.trim().split(/\s+/).filter(Boolean);if(!n.length)return s;const a=n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");try{return s.replace(new RegExp(`(${a})`,"gi"),'$1')}catch{return s}}const Sk={template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h({}),a=h({}),i=h(null),l=h(""),r=h(null),o=h(!1),c=h("create"),d=h(""),u=h(""),p=h(null),f=h(null),b=h(!1),y=h(null),E=h(null),O=h(!1),x=J(()=>e.value.length),m=J(()=>e.value.reduce((se,me)=>se+(me.execution_count||0),0)),_=J(()=>e.value.reduce((se,me)=>se+M(me.code),0)),S=J(()=>{if(!l.value)return e.value;const se=l.value.toLowerCase();return e.value.filter(me=>me.name.toLowerCase().includes(se)||(me.description||"").toLowerCase().includes(se))}),g=J(()=>u.value?u.value.split(` +`).length:0),w=J(()=>{const se=Math.max(g.value,1);return Array.from({length:se},(me,W)=>W+1).join(` +`)}),T=J(()=>{const se=u.value.trim();return se?se.includes("SKILL_DEFINITION")?se.includes("async def execute")?{valid:!0,message:""}:{valid:!1,message:"Missing async def execute function"}:{valid:!1,message:"Missing SKILL_DEFINITION dict"}:null});function C(se){return xk(se)}function M(se){return se?se.split(` +`).length:0}function H(se){return _k(se)}function P(se){n.value={...n.value,[se]:!n.value[se]}}async function R(se){try{await navigator.clipboard.writeText(se);const me=e.value.find(W=>W.code===se);me&&(r.value=me.name,setTimeout(()=>{r.value=null},2e3))}catch{}}function V(se){if(se.key==="Tab"){se.preventDefault();const me=se.target,W=me.selectionStart,B=me.selectionEnd;u.value=u.value.substring(0,W)+" "+u.value.substring(B),Rt(()=>{me.selectionStart=me.selectionEnd=W+4})}}function Q(se){const me=se.target.previousElementSibling;me&&(me.scrollTop=se.target.scrollTop)}async function U(){t.value=!0,s.value=null;try{e.value=await q.get("/api/skills")}catch(se){s.value=se.message}t.value=!1}async function N(se){i.value=se,delete a.value[se],a.value={...a.value};try{const me=await q.post(`/api/skills/${encodeURIComponent(se)}/test`);a.value={...a.value,[se]:me}}catch(me){a.value={...a.value,[se]:{result:me.message,is_error:!0}}}i.value=null}function I(){o.value=!0,c.value="create",d.value="",u.value="",p.value=null,f.value=null}function Y(se){o.value=!0,c.value="edit",d.value=se.name,u.value=se.code||"",p.value=null,f.value=null}function Se(){o.value=!1,p.value=null,f.value=null}async function we(){p.value=null,f.value=null;const se=d.value.trim(),me=u.value.trim();if(!se){p.value="Name is required";return}if(!me){p.value="Code is required";return}b.value=!0;try{c.value==="create"?(await q.post("/api/skills",{name:se,code:me}),f.value="Skill created successfully"):(await q.put(`/api/skills/${encodeURIComponent(se)}`,{code:me}),f.value="Skill updated successfully"),await U(),setTimeout(()=>{o.value=!1},800)}catch(W){p.value=W.message}b.value=!1}function re(se){E.value=se}async function he(){if(E.value){O.value=!0;try{await q.del(`/api/skills/${encodeURIComponent(E.value)}`),await U()}catch(se){Ee.error(`Failed to delete skill: ${se.message||"unknown error"}`)}O.value=!1,E.value=null}}return We(()=>{U()}),{skills:e,loading:t,error:s,showCode:n,testResults:a,testing:i,search:l,copied:r,editing:o,editMode:c,editName:d,editCode:u,editError:p,editSuccess:f,saving:b,editorRef:y,deleteTarget:E,deleting:O,enabledCount:x,totalExecutions:m,totalLines:_,displayedSkills:S,editLineCount:g,editorLineNums:w,editValidation:T,highlight:C,truncate:Zc,formatTs:fa,countLines:M,getLineNumbers:H,toggleCode:P,copyCode:R,handleEditorKey:V,syncScroll:Q,fetchSkills:U,testSkill:N,showCreate:I,editSkill:Y,cancelEdit:Se,saveSkill:we,confirmDelete:re,doDelete:he}}};function wk(e,t){if(!e||!t)return Nu(e);const s=Nu(e),n=t.trim().split(/\s+/).filter(Boolean);if(!n.length)return s;const a=n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");try{return s.replace(new RegExp(`(${a})`,"gi"),'$1')}catch{return s}}const Sk={template:`

Knowledge

@@ -2739,7 +2762,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(""),a=h(null),i=h(!1),l=h(""),r=h(null),o=h(!1),c=h(""),d=h(""),u=h(null),f=h(null),p=h(!1),b=h(null),y=h(null);let E=null;const I=h(null),x=h(!1),m=h({}),_=h({}),S=h(null),g=h(null),w=J(()=>e.value.reduce((N,Y)=>N+(Y.chunks||0),0)),T=J(()=>new Set(e.value.map(Y=>Y.uploader).filter(Boolean)).size);function C(N,Y){const we=_.value[Y];if(!we||we.length===0)return 0;const ke=Math.max(...we.map(ie=>ie.char_count||0));return ke===0?0:Math.round(N.char_count/ke*100)}async function M(){t.value=!0,s.value=null;try{const N=await G.get("/api/knowledge");e.value=Array.isArray(N)?N:[]}catch(N){s.value=N.message}t.value=!1}async function H(N){if(m.value[N]){m.value[N]=!1,g.value=null;return}if(m.value[N]=!0,!(_.value[N]||S.value===N)){S.value=N;try{const Y=await G.get(`/api/knowledge/${encodeURIComponent(N)}/chunks`);_.value[N]=Array.isArray(Y)?Y:[]}catch(Y){_.value[N]=[],Ae.error(`Failed to load chunks: ${Y.message}`)}S.value=null}}async function P(){const N=n.value.trim();if(N){i.value=!0,r.value=null,l.value=N;try{const Y=await G.get(`/api/knowledge/search?q=${encodeURIComponent(N)}`);a.value=Array.isArray(Y)?Y:[]}catch(Y){a.value=[],r.value=Y.message||"Search failed"}i.value=!1}}function R(){a.value=null,n.value="",r.value=null}async function j(){u.value=null,f.value=null;const N=c.value.trim(),Y=d.value.trim();if(!N){u.value="Source name is required";return}if(!Y){u.value="Content is required";return}p.value=!0;try{const we=await G.post("/api/knowledge",{source:N,content:Y});f.value=`Ingested ${we.chunks||0} chunks from "${N}"`,c.value="",d.value="",_.value={},await M(),setTimeout(()=>{o.value=!1,f.value=null},1500)}catch(we){u.value=we.message}p.value=!1}async function Q(N){b.value=N,y.value=null,E&&(clearTimeout(E),E=null);try{const Y=await G.post(`/api/knowledge/${encodeURIComponent(N)}/reingest`);y.value={source:N,error:!1,message:`Re-ingested ${Y.chunks||0} chunks`},delete _.value[N],await M(),E=setTimeout(()=>{y.value=null,E=null},3e3)}catch(Y){y.value={source:N,error:!0,message:Y.message}}b.value=null}function U(N){I.value=N}async function O(){if(I.value){x.value=!0;try{await G.del(`/api/knowledge/${encodeURIComponent(I.value)}`),delete _.value[I.value],await M()}catch(N){Ae.error(`Failed to delete source: ${N.message||"unknown error"}`)}x.value=!1,I.value=null}}return We(()=>{M()}),{sources:e,loading:t,error:s,searchQuery:n,searchResults:a,searching:i,lastQuery:l,searchError:r,showIngest:o,ingestSource:c,ingestContent:d,ingestError:u,ingestSuccess:f,ingesting:p,reingesting:b,reingestResult:y,deleteTarget:I,deleting:x,expanded:m,sourceChunks:_,loadingChunks:S,selectedChunk:g,totalChunks:w,uploaderCount:T,truncate:Zc,formatTs:pa,highlightTerms:wk,chunkBarWidth:C,fetchSources:M,toggleSource:H,doSearch:P,clearSearch:R,doIngest:j,doReingest:Q,confirmDelete:U,doDelete:O}}},Tk={template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h(""),a=h(null),i=h(!1),l=h(""),r=h(null),o=h(!1),c=h(""),d=h(""),u=h(null),p=h(null),f=h(!1),b=h(null),y=h(null);let E=null;const O=h(null),x=h(!1),m=h({}),_=h({}),S=h(null),g=h(null),w=J(()=>e.value.reduce((I,Y)=>I+(Y.chunks||0),0)),T=J(()=>new Set(e.value.map(Y=>Y.uploader).filter(Boolean)).size);function C(I,Y){const Se=_.value[Y];if(!Se||Se.length===0)return 0;const we=Math.max(...Se.map(re=>re.char_count||0));return we===0?0:Math.round(I.char_count/we*100)}async function M(){t.value=!0,s.value=null;try{const I=await q.get("/api/knowledge");e.value=Array.isArray(I)?I:[]}catch(I){s.value=I.message}t.value=!1}async function H(I){if(m.value[I]){m.value[I]=!1,g.value=null;return}if(m.value[I]=!0,!(_.value[I]||S.value===I)){S.value=I;try{const Y=await q.get(`/api/knowledge/${encodeURIComponent(I)}/chunks`);_.value[I]=Array.isArray(Y)?Y:[]}catch(Y){_.value[I]=[],Ee.error(`Failed to load chunks: ${Y.message}`)}S.value=null}}async function P(){const I=n.value.trim();if(I){i.value=!0,r.value=null,l.value=I;try{const Y=await q.get(`/api/knowledge/search?q=${encodeURIComponent(I)}`);a.value=Array.isArray(Y)?Y:[]}catch(Y){a.value=[],r.value=Y.message||"Search failed"}i.value=!1}}function R(){a.value=null,n.value="",r.value=null}async function V(){u.value=null,p.value=null;const I=c.value.trim(),Y=d.value.trim();if(!I){u.value="Source name is required";return}if(!Y){u.value="Content is required";return}f.value=!0;try{const Se=await q.post("/api/knowledge",{source:I,content:Y});p.value=`Ingested ${Se.chunks||0} chunks from "${I}"`,c.value="",d.value="",_.value={},await M(),setTimeout(()=>{o.value=!1,p.value=null},1500)}catch(Se){u.value=Se.message}f.value=!1}async function Q(I){b.value=I,y.value=null,E&&(clearTimeout(E),E=null);try{const Y=await q.post(`/api/knowledge/${encodeURIComponent(I)}/reingest`);y.value={source:I,error:!1,message:`Re-ingested ${Y.chunks||0} chunks`},delete _.value[I],await M(),E=setTimeout(()=>{y.value=null,E=null},3e3)}catch(Y){y.value={source:I,error:!0,message:Y.message}}b.value=null}function U(I){O.value=I}async function N(){if(O.value){x.value=!0;try{await q.del(`/api/knowledge/${encodeURIComponent(O.value)}`),delete _.value[O.value],await M()}catch(I){Ee.error(`Failed to delete source: ${I.message||"unknown error"}`)}x.value=!1,O.value=null}}return We(()=>{M()}),{sources:e,loading:t,error:s,searchQuery:n,searchResults:a,searching:i,lastQuery:l,searchError:r,showIngest:o,ingestSource:c,ingestContent:d,ingestError:u,ingestSuccess:p,ingesting:f,reingesting:b,reingestResult:y,deleteTarget:O,deleting:x,expanded:m,sourceChunks:_,loadingChunks:S,selectedChunk:g,totalChunks:w,uploaderCount:T,truncate:Zc,formatTs:fa,highlightTerms:wk,chunkBarWidth:C,fetchSources:M,toggleSource:H,doSearch:P,clearSearch:R,doIngest:V,doReingest:Q,confirmDelete:U,doDelete:N}}},Tk={template:`

Memory

@@ -2931,7 +2954,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h({}),s=h(!0),n=h(null),a=h({}),i=h(null),l=h(""),r=h(!1),o=h({scope:"global",key:"",value:""}),c=h(!1),d=h(null),u=h(null),f=h(null),p=h(""),b=h(!1),y=h(null),E=h(null),I=h(new Set),x=h(null),m=h(!1),_=h(!1),S=J(()=>e.value.reduce((ie,he)=>ie+he.count,0)),g=J(()=>I.value.size);function w(ie){const he=t.value[ie];if(!he)return[];if(!l.value.trim())return he;const F=l.value.trim().toLowerCase();return he.filter(se=>se.key.toLowerCase().includes(F)||se.value&&se.value.toLowerCase().includes(F))}function T(ie,he){return I.value.has(ie+"/"+he)}function C(ie,he){const F=ie+"/"+he,se=new Set(I.value);se.has(F)?se.delete(F):se.add(F),I.value=se}function M(ie){const he=t.value[ie];return!he||he.length===0?!1:he.every(F=>I.value.has(ie+"/"+F.key))}function H(ie,he){const F=t.value[ie];if(!F)return;const se=new Set(I.value);for(const Se of F){const V=ie+"/"+Se.key;he?se.add(V):se.delete(V)}I.value=se}async function P(){s.value=!0,n.value=null;try{const ie=await G.get("/api/memory");e.value=Object.entries(ie).map(([he,F])=>({name:he,keys:F.keys||[],count:F.count||0}))}catch(ie){n.value=ie.message}s.value=!1}async function R(ie){if(a.value[ie]){a.value[ie]=!1;return}a.value[ie]=!0;const he=e.value.find(se=>se.name===ie);if(!he||t.value[ie]||i.value===ie)return;i.value=ie;let F;try{const Se=(await G.get(`/api/memory/${encodeURIComponent(ie)}`)).entries||{};F=he.keys.map(V=>Object.prototype.hasOwnProperty.call(Se,V)?{key:V,value:Se[V]||"",failed:!1}:{key:V,value:"",failed:!0,error:"Not found in scope"})}catch(se){F=he.keys.map(Se=>({key:Se,value:"",failed:!0,error:se.message||"Failed to load"}))}t.value[ie]=F,i.value=null}function j(ie,he,F){f.value=ie+"/"+he,p.value=F}async function Q(ie,he){b.value=!0,y.value=null;try{await G.put(`/api/memory/${encodeURIComponent(ie)}/${encodeURIComponent(he)}`,{value:p.value});const F=t.value[ie];if(F){const se=F.find(Se=>Se.key===he);se&&(se.value=p.value)}f.value=null}catch(F){y.value=`Failed to save: ${F.message||"unknown error"}`}b.value=!1}async function U(ie,he){try{await navigator.clipboard.writeText(he.value),E.value=ie+"/"+he.key,setTimeout(()=>{E.value=null},1500)}catch{}}async function O(){d.value=null,u.value=null;const ie=o.value.scope.trim(),he=o.value.key.trim(),F=o.value.value.trim();if(!ie){d.value="Scope is required";return}if(!he){d.value="Key is required";return}if(!F){d.value="Value is required";return}c.value=!0;try{await G.put(`/api/memory/${encodeURIComponent(ie)}/${encodeURIComponent(he)}`,{value:F}),u.value="Entry saved",o.value={scope:"global",key:"",value:""},t.value={},await P(),setTimeout(()=>{r.value=!1,u.value=null},800)}catch(se){d.value=se.message}c.value=!1}function N(ie,he){x.value={scope:ie,key:he}}async function Y(){if(!x.value)return;m.value=!0,y.value=null;const{scope:ie,key:he}=x.value;try{await G.del(`/api/memory/${encodeURIComponent(ie)}/${encodeURIComponent(he)}`);const F=t.value[ie];F&&(t.value[ie]=F.filter(V=>V.key!==he));const se=e.value.find(V=>V.name===ie);se&&(se.count--,se.keys=se.keys.filter(V=>V!==he));const Se=new Set(I.value);Se.delete(ie+"/"+he),I.value=Se}catch(F){y.value=`Failed to delete: ${F.message||"unknown error"}`}m.value=!1,x.value=null}function we(){_.value=!0}async function ke(){m.value=!0,y.value=null;const ie=[];for(const he of I.value){const F=he.indexOf("/");ie.push({scope:he.slice(0,F),key:he.slice(F+1)})}try{await G.post("/api/memory/bulk-delete",{entries:ie}),I.value=new Set,t.value={},await P()}catch(he){y.value=`Bulk delete failed: ${he.message||"unknown error"}`}m.value=!1,_.value=!1}return We(()=>{P()}),{scopes:e,scopeEntries:t,loading:s,error:n,expanded:a,loadingScope:i,filterQuery:l,showAdd:r,addForm:o,adding:c,addError:d,addSuccess:u,editingKey:f,editValue:p,saving:b,actionError:y,copied:E,selected:I,selectedCount:g,totalEntries:S,deleteTarget:x,deleting:m,showBulkDelete:_,fetchMemory:P,toggleScope:R,startEdit:j,doEdit:Q,copyValue:U,doAdd:O,confirmDelete:N,doDelete:Y,confirmBulkDelete:we,doBulkDelete:ke,isSelected:T,toggleSelect:C,isScopeAllSelected:M,toggleSelectAll:H,filteredEntries:w}}},Ck={template:` + `,setup(){const e=h([]),t=h({}),s=h(!0),n=h(null),a=h({}),i=h(null),l=h(""),r=h(!1),o=h({scope:"global",key:"",value:""}),c=h(!1),d=h(null),u=h(null),p=h(null),f=h(""),b=h(!1),y=h(null),E=h(null),O=h(new Set),x=h(null),m=h(!1),_=h(!1),S=J(()=>e.value.reduce((re,he)=>re+he.count,0)),g=J(()=>O.value.size);function w(re){const he=t.value[re];if(!he)return[];if(!l.value.trim())return he;const se=l.value.trim().toLowerCase();return he.filter(me=>me.key.toLowerCase().includes(se)||me.value&&me.value.toLowerCase().includes(se))}function T(re,he){return O.value.has(re+"/"+he)}function C(re,he){const se=re+"/"+he,me=new Set(O.value);me.has(se)?me.delete(se):me.add(se),O.value=me}function M(re){const he=t.value[re];return!he||he.length===0?!1:he.every(se=>O.value.has(re+"/"+se.key))}function H(re,he){const se=t.value[re];if(!se)return;const me=new Set(O.value);for(const W of se){const B=re+"/"+W.key;he?me.add(B):me.delete(B)}O.value=me}async function P(){s.value=!0,n.value=null;try{const re=await q.get("/api/memory");e.value=Object.entries(re).map(([he,se])=>({name:he,keys:se.keys||[],count:se.count||0}))}catch(re){n.value=re.message}s.value=!1}async function R(re){if(a.value[re]){a.value[re]=!1;return}a.value[re]=!0;const he=e.value.find(me=>me.name===re);if(!he||t.value[re]||i.value===re)return;i.value=re;let se;try{const W=(await q.get(`/api/memory/${encodeURIComponent(re)}`)).entries||{};se=he.keys.map(B=>Object.prototype.hasOwnProperty.call(W,B)?{key:B,value:W[B]||"",failed:!1}:{key:B,value:"",failed:!0,error:"Not found in scope"})}catch(me){se=he.keys.map(W=>({key:W,value:"",failed:!0,error:me.message||"Failed to load"}))}t.value[re]=se,i.value=null}function V(re,he,se){p.value=re+"/"+he,f.value=se}async function Q(re,he){b.value=!0,y.value=null;try{await q.put(`/api/memory/${encodeURIComponent(re)}/${encodeURIComponent(he)}`,{value:f.value});const se=t.value[re];if(se){const me=se.find(W=>W.key===he);me&&(me.value=f.value)}p.value=null}catch(se){y.value=`Failed to save: ${se.message||"unknown error"}`}b.value=!1}async function U(re,he){try{await navigator.clipboard.writeText(he.value),E.value=re+"/"+he.key,setTimeout(()=>{E.value=null},1500)}catch{}}async function N(){d.value=null,u.value=null;const re=o.value.scope.trim(),he=o.value.key.trim(),se=o.value.value.trim();if(!re){d.value="Scope is required";return}if(!he){d.value="Key is required";return}if(!se){d.value="Value is required";return}c.value=!0;try{await q.put(`/api/memory/${encodeURIComponent(re)}/${encodeURIComponent(he)}`,{value:se}),u.value="Entry saved",o.value={scope:"global",key:"",value:""},t.value={},await P(),setTimeout(()=>{r.value=!1,u.value=null},800)}catch(me){d.value=me.message}c.value=!1}function I(re,he){x.value={scope:re,key:he}}async function Y(){if(!x.value)return;m.value=!0,y.value=null;const{scope:re,key:he}=x.value;try{await q.del(`/api/memory/${encodeURIComponent(re)}/${encodeURIComponent(he)}`);const se=t.value[re];se&&(t.value[re]=se.filter(B=>B.key!==he));const me=e.value.find(B=>B.name===re);me&&(me.count--,me.keys=me.keys.filter(B=>B!==he));const W=new Set(O.value);W.delete(re+"/"+he),O.value=W}catch(se){y.value=`Failed to delete: ${se.message||"unknown error"}`}m.value=!1,x.value=null}function Se(){_.value=!0}async function we(){m.value=!0,y.value=null;const re=[];for(const he of O.value){const se=he.indexOf("/");re.push({scope:he.slice(0,se),key:he.slice(se+1)})}try{await q.post("/api/memory/bulk-delete",{entries:re}),O.value=new Set,t.value={},await P()}catch(he){y.value=`Bulk delete failed: ${he.message||"unknown error"}`}m.value=!1,_.value=!1}return We(()=>{P()}),{scopes:e,scopeEntries:t,loading:s,error:n,expanded:a,loadingScope:i,filterQuery:l,showAdd:r,addForm:o,adding:c,addError:d,addSuccess:u,editingKey:p,editValue:f,saving:b,actionError:y,copied:E,selected:O,selectedCount:g,totalEntries:S,deleteTarget:x,deleting:m,showBulkDelete:_,fetchMemory:P,toggleScope:R,startEdit:V,doEdit:Q,copyValue:U,doAdd:N,confirmDelete:I,doDelete:Y,confirmBulkDelete:Se,doBulkDelete:we,isSelected:T,toggleSelect:C,isScopeAllSelected:M,toggleSelectAll:H,filteredEntries:w}}},Ck={template:`
@@ -3000,7 +3023,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(null),s=h(!0),n=h(null),a=h(null),i=h(null),l=h(""),r=J(()=>[...new Set(e.value.map(E=>E.category))].sort()),o=J(()=>{const y={};return e.value.forEach(E=>{y[E.category]=(y[E.category]||0)+1}),y}),c=J(()=>a.value?e.value.filter(y=>y.category===a.value):e.value);function d(y){return y==="correction"?"badge-warning":y==="operational"?"badge-info":y==="preference"?"badge-success":"badge-info"}function u(y){i.value=y.key,l.value=y.content}async function f(y){try{await G.put("/api/learned/"+encodeURIComponent(y),{content:l.value}),i.value=null,Ae.success("Entry updated"),await b()}catch(E){Ae.error(E.message||"Failed to save entry")}}async function p(y){if(await _s({title:"Delete learned entry",message:`Delete "${y}"? Odin will no longer apply this learned context.`,confirmLabel:"Delete",danger:!0}))try{await G.del("/api/learned/"+encodeURIComponent(y)),Ae.success("Entry deleted"),await b()}catch(I){Ae.error(I.message||"Failed to delete entry")}}async function b(){s.value=!0,n.value=null;try{const y=await G.get("/api/learned");e.value=y.entries||[],t.value={last_reflection:y.last_reflection,count:y.count}}catch(y){n.value=y.message}s.value=!1}return We(b),{entries:e,meta:t,loading:s,error:n,filterCat:a,editing:i,editContent:l,categories:r,catCounts:o,filtered:c,catBadge:d,formatTs:pa,startEdit:u,saveEdit:f,deleteEntry:p,fetchEntries:b}}},wm=[{id:"tools",label:"Tools",component:yk},{id:"skills",label:"Skills",component:kk},{id:"knowledge",label:"Knowledge",component:Sk},{id:"memory",label:"Memory",component:Tk},{id:"learned",label:"Learned",component:Ck}],Ek={components:{TabbedPage:Mr},setup(){return{tabs:wm}},template:''},Ak={ok:"text-green-400",degraded:"text-yellow-400",down:"text-red-400",unconfigured:"text-gray-500"},Rk={ok:"success",degraded:"warning",down:"error",unconfigured:"minus"},Ik={healthy:"text-green-400",degraded:"text-yellow-400",unhealthy:"text-red-400"},Ok={template:` + `,setup(){const e=h([]),t=h(null),s=h(!0),n=h(null),a=h(null),i=h(null),l=h(""),r=J(()=>[...new Set(e.value.map(E=>E.category))].sort()),o=J(()=>{const y={};return e.value.forEach(E=>{y[E.category]=(y[E.category]||0)+1}),y}),c=J(()=>a.value?e.value.filter(y=>y.category===a.value):e.value);function d(y){return y==="correction"?"badge-warning":y==="operational"?"badge-info":y==="preference"?"badge-success":"badge-info"}function u(y){i.value=y.key,l.value=y.content}async function p(y){try{await q.put("/api/learned/"+encodeURIComponent(y),{content:l.value}),i.value=null,Ee.success("Entry updated"),await b()}catch(E){Ee.error(E.message||"Failed to save entry")}}async function f(y){if(await _s({title:"Delete learned entry",message:`Delete "${y}"? Odin will no longer apply this learned context.`,confirmLabel:"Delete",danger:!0}))try{await q.del("/api/learned/"+encodeURIComponent(y)),Ee.success("Entry deleted"),await b()}catch(O){Ee.error(O.message||"Failed to delete entry")}}async function b(){s.value=!0,n.value=null;try{const y=await q.get("/api/learned");e.value=y.entries||[],t.value={last_reflection:y.last_reflection,count:y.count}}catch(y){n.value=y.message}s.value=!1}return We(b),{entries:e,meta:t,loading:s,error:n,filterCat:a,editing:i,editContent:l,categories:r,catCounts:o,filtered:c,catBadge:d,formatTs:fa,startEdit:u,saveEdit:p,deleteEntry:f,fetchEntries:b}}},wm=[{id:"tools",label:"Tools",component:yk},{id:"skills",label:"Skills",component:kk},{id:"knowledge",label:"Knowledge",component:Sk},{id:"memory",label:"Memory",component:Tk},{id:"learned",label:"Learned",component:Ck}],Ek={components:{TabbedPage:Mr},setup(){return{tabs:wm}},template:''},Ak={ok:"text-green-400",degraded:"text-yellow-400",down:"text-red-400",unconfigured:"text-gray-500"},Rk={ok:"success",degraded:"warning",down:"error",unconfigured:"minus"},Ik={healthy:"text-green-400",degraded:"text-yellow-400",unhealthy:"text-red-400"},Ok={template:`
@@ -3142,7 +3165,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h({}),t=h(!0),s=h(null),n=h(!1),a=h(!1),i=J(()=>e.value.components||[]),l=J(()=>Ik[e.value.overall]||"text-gray-400"),r=J(()=>e.value.overall==="healthy"?"success":e.value.overall==="degraded"?"warning":e.value.overall==="unhealthy"?"error":"minus"),o=J(()=>{const g=e.value.overall;return g==="healthy"?"All Systems Healthy":g==="degraded"?"Some Systems Degraded":g==="unhealthy"?"System Issues Detected":"Unknown"});function c(g){return Ak[g]||"text-gray-400"}function d(g){return Rk[g]||"info"}function u(g){return g==="ok"?"badge-success":g==="degraded"?"badge-warning":g==="down"?"badge-danger":"badge-info"}function f(g){return g==="closed"?"text-green-400":g==="half_open"?"text-yellow-400":g==="open"?"text-red-400":"text-gray-400"}function p(g){return g.replace(/_/g," ").replace(/\b\w/g,w=>w.toUpperCase())}function b(g){if(!g)return"—";try{return new Date(g).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return g}}function y(g){return g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"K":String(g)}async function E(){a.value=!0;try{e.value=await G.get("/api/health/components"),s.value=null,n.value=!0}catch(g){s.value=g.message}finally{t.value=!1,a.value=!1}}function I(){t.value=!0,s.value=null,E()}let x=null,m=!1;function _(){m||(m=!0,E(),x||(x=setInterval(E,3e4)))}function S(){m&&(m=!1,x&&(clearInterval(x),x=null))}return We(_),Ds(_),Ms(S),xt(S),{data:e,hasData:n,loading:t,error:s,refreshing:a,components:i,overallColor:l,overallIcon:r,overallLabel:o,statusColor:c,statusIcon:d,badgeClass:u,circuitColor:f,formatName:p,formatTime:b,formatNumber:y,fetchHealth:E,retry:I}}},Nk={template:` + `,setup(){const e=h({}),t=h(!0),s=h(null),n=h(!1),a=h(!1),i=J(()=>e.value.components||[]),l=J(()=>Ik[e.value.overall]||"text-gray-400"),r=J(()=>e.value.overall==="healthy"?"success":e.value.overall==="degraded"?"warning":e.value.overall==="unhealthy"?"error":"minus"),o=J(()=>{const g=e.value.overall;return g==="healthy"?"All Systems Healthy":g==="degraded"?"Some Systems Degraded":g==="unhealthy"?"System Issues Detected":"Unknown"});function c(g){return Ak[g]||"text-gray-400"}function d(g){return Rk[g]||"info"}function u(g){return g==="ok"?"badge-success":g==="degraded"?"badge-warning":g==="down"?"badge-danger":"badge-info"}function p(g){return g==="closed"?"text-green-400":g==="half_open"?"text-yellow-400":g==="open"?"text-red-400":"text-gray-400"}function f(g){return g.replace(/_/g," ").replace(/\b\w/g,w=>w.toUpperCase())}function b(g){if(!g)return"—";try{return new Date(g).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return g}}function y(g){return g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"K":String(g)}async function E(){a.value=!0;try{e.value=await q.get("/api/health/components"),s.value=null,n.value=!0}catch(g){s.value=g.message}finally{t.value=!1,a.value=!1}}function O(){t.value=!0,s.value=null,E()}let x=null,m=!1;function _(){m||(m=!0,E(),x||(x=setInterval(E,3e4)))}function S(){m&&(m=!1,x&&(clearInterval(x),x=null))}return We(_),Ds(_),Ms(S),xt(S),{data:e,hasData:n,loading:t,error:s,refreshing:a,components:i,overallColor:l,overallIcon:r,overallLabel:o,statusColor:c,statusIcon:d,badgeClass:u,circuitColor:p,formatName:f,formatTime:b,formatNumber:y,fetchHealth:E,retry:O}}},Nk={template:`
@@ -3385,7 +3408,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(!0),t=h(null),s=h(!1),n=h(!1),a=h("sessions"),i=h(null);let l=null;const r=[{key:"sessions",label:"Sessions"},{key:"knowledge",label:"Knowledge"},{key:"trajectories",label:"Trajectories"},{key:"storage",label:"Storage"}],o=J(()=>{if(!i.value||!i.value.collected_at)return"";try{return new Date(i.value.collected_at).toLocaleTimeString()}catch{return""}}),c=J(()=>{if(!i.value)return[];const E=i.value,I=E.storage_total_bytes||1;return[{label:"Session Persistence",mb:E.sessions.persist_dir.total_mb,bytes:E.sessions.persist_dir.total_bytes,files:E.sessions.persist_dir.file_count,pct:Math.min(100,Math.round(E.sessions.persist_dir.total_bytes/I*100)),color:"res-bar-blue"},{label:"Knowledge Database",mb:E.knowledge.db_file.total_mb,bytes:E.knowledge.db_file.total_bytes,files:E.knowledge.db_file.file_count,pct:Math.min(100,Math.round(E.knowledge.db_file.total_bytes/I*100)),color:"res-bar-purple"},{label:"Message Trajectories",mb:E.trajectories.message_dir.total_mb,bytes:E.trajectories.message_dir.total_bytes,files:E.trajectories.message_dir.file_count,pct:Math.min(100,Math.round(E.trajectories.message_dir.total_bytes/I*100)),color:"res-bar-emerald"},{label:"Agent Trajectories",mb:E.trajectories.agent_dir.total_mb,bytes:E.trajectories.agent_dir.total_bytes,files:E.trajectories.agent_dir.file_count,pct:Math.min(100,Math.round(E.trajectories.agent_dir.total_bytes/I*100)),color:"res-bar-amber"}]});async function d(){try{const E=await G.get("/api/resource-usage");i.value=E,t.value=null,s.value=!0}catch(E){t.value=E.message||"Failed to load resource usage"}finally{e.value=!1,n.value=!1}}async function u(){n.value=!0,await d()}function f(){e.value=!0,t.value=null,d()}let p=!1;function b(){p||(p=!0,d(),l||(l=setInterval(d,3e4)))}function y(){p&&(p=!1,l&&(clearInterval(l),l=null))}return We(b),Ds(b),Ms(y),xt(y),{hasData:s,loading:e,error:t,refreshing:n,data:i,activeTab:a,tabs:r,collectedAt:o,storageItems:c,fmtNum:vm,refresh:u,retry:f}}},Lk=["INFO","WARNING","ERROR"],Dk=[{id:"all",name:"All Logs",icon:"list",filters:{}},{id:"errors",name:"Errors Only",icon:"error",filters:{level:"ERROR"}},{id:"warnings",name:"Warnings+",icon:"warning",filters:{levels:["WARNING","ERROR"]}},{id:"tools",name:"Tool Activity",icon:"wrench",filters:{hasToolName:!0}},{id:"recent-errors",name:"Recent Errors",icon:"flame",filters:{level:"ERROR",timeRange:"last_1h"}}],ao=[{value:"",label:"All Time"},{value:"last_5m",label:"Last 5 min",seconds:300},{value:"last_15m",label:"Last 15 min",seconds:900},{value:"last_1h",label:"Last 1 hour",seconds:3600},{value:"last_4h",label:"Last 4 hours",seconds:14400},{value:"last_24h",label:"Last 24 hours",seconds:86400}],Mk=[50,100,200,500],Pk={template:` + `,setup(){const e=h(!0),t=h(null),s=h(!1),n=h(!1),a=h("sessions"),i=h(null);let l=null;const r=[{key:"sessions",label:"Sessions"},{key:"knowledge",label:"Knowledge"},{key:"trajectories",label:"Trajectories"},{key:"storage",label:"Storage"}],o=J(()=>{if(!i.value||!i.value.collected_at)return"";try{return new Date(i.value.collected_at).toLocaleTimeString()}catch{return""}}),c=J(()=>{if(!i.value)return[];const E=i.value,O=E.storage_total_bytes||1;return[{label:"Session Persistence",mb:E.sessions.persist_dir.total_mb,bytes:E.sessions.persist_dir.total_bytes,files:E.sessions.persist_dir.file_count,pct:Math.min(100,Math.round(E.sessions.persist_dir.total_bytes/O*100)),color:"res-bar-blue"},{label:"Knowledge Database",mb:E.knowledge.db_file.total_mb,bytes:E.knowledge.db_file.total_bytes,files:E.knowledge.db_file.file_count,pct:Math.min(100,Math.round(E.knowledge.db_file.total_bytes/O*100)),color:"res-bar-purple"},{label:"Message Trajectories",mb:E.trajectories.message_dir.total_mb,bytes:E.trajectories.message_dir.total_bytes,files:E.trajectories.message_dir.file_count,pct:Math.min(100,Math.round(E.trajectories.message_dir.total_bytes/O*100)),color:"res-bar-emerald"},{label:"Agent Trajectories",mb:E.trajectories.agent_dir.total_mb,bytes:E.trajectories.agent_dir.total_bytes,files:E.trajectories.agent_dir.file_count,pct:Math.min(100,Math.round(E.trajectories.agent_dir.total_bytes/O*100)),color:"res-bar-amber"}]});async function d(){try{const E=await q.get("/api/resource-usage");i.value=E,t.value=null,s.value=!0}catch(E){t.value=E.message||"Failed to load resource usage"}finally{e.value=!1,n.value=!1}}async function u(){n.value=!0,await d()}function p(){e.value=!0,t.value=null,d()}let f=!1;function b(){f||(f=!0,d(),l||(l=setInterval(d,3e4)))}function y(){f&&(f=!1,l&&(clearInterval(l),l=null))}return We(b),Ds(b),Ms(y),xt(y),{hasData:s,loading:e,error:t,refreshing:n,data:i,activeTab:a,tabs:r,collectedAt:o,storageItems:c,fmtNum:vm,refresh:u,retry:p}}},Lk=["INFO","WARNING","ERROR"],Dk=[{id:"all",name:"All Logs",icon:"list",filters:{}},{id:"errors",name:"Errors Only",icon:"error",filters:{level:"ERROR"}},{id:"warnings",name:"Warnings+",icon:"warning",filters:{levels:["WARNING","ERROR"]}},{id:"tools",name:"Tool Activity",icon:"wrench",filters:{hasToolName:!0}},{id:"recent-errors",name:"Recent Errors",icon:"flame",filters:{level:"ERROR",timeRange:"last_1h"}}],ao=[{value:"",label:"All Time"},{value:"last_5m",label:"Last 5 min",seconds:300},{value:"last_15m",label:"Last 15 min",seconds:900},{value:"last_1h",label:"Last 1 hour",seconds:3600},{value:"last_4h",label:"Last 4 hours",seconds:14400},{value:"last_24h",label:"Last 24 hours",seconds:86400}],Mk=[50,100,200,500],Pk={template:`
@@ -3743,9 +3766,9 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h("live"),t=h([]),s=h(!1),n=h(!0),a=h(""),i=h(""),l=h(!1),r=h(!1),o=h(Ke.state||"disconnected"),c=J(()=>{switch(o.value){case"connected":return"Live";case"connecting":return"Connecting…";case"reconnecting":return"Reconnecting…";default:return"Disconnected"}}),d=h(null),u=h(!1),f=h(null),p=2e3,b=Lk,y=Dk,E=ao,I=h("all"),x=h(""),m=h([]),_=h(!1),S=h(""),g=h([]);function w(){try{const q=localStorage.getItem("odin-log-presets");q&&(m.value=JSON.parse(q))}catch{}}function T(){try{localStorage.setItem("odin-log-presets",JSON.stringify(m.value))}catch{}}const C=J(()=>a.value!==""||i.value.trim()!==""||x.value!==""),M=J(()=>{const q=ao.find(re=>re.value===x.value);return q?q.label:""}),H=J(()=>{if(!l.value||!i.value)return null;try{return new RegExp(i.value,"i"),null}catch(q){return q.message}}),P=24,R=J(()=>{if(we.value.length===0)return[];const q=[],re=new Date,Ee=3600*1e3;for(let Ze=P-1;Ze>=0;Ze--){const lt=new Date(re.getTime()-(Ze+1)*Ee),Ot=new Date(re.getTime()-Ze*Ee);q.push({start:lt,end:Ot,label:O(lt,Ot),shortLabel:Ot.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),total:0,info:0,warnings:0,errors:0})}for(const Ze of we.value){if(!Ze._time)continue;const lt=Ze._time.getTime();for(const Ot of q)if(lt>=Ot.start.getTime()&<{let q=1;for(const re of R.value)re.total>q&&(q=re.total);return q}),Q=J(()=>{if(R.value.length===0)return"";const q=we.value.map(Ze=>Ze._time&&Ze._time.getTime()).filter(Boolean);if(q.length===0)return"";const re=new Date(Math.min(...q));return`${we.value.length} shown, oldest ${re.toLocaleTimeString()}`}),U=J(()=>Math.ceil(P/8));function O(q,re){const Ee={hour:"2-digit",minute:"2-digit"};return q.toLocaleTimeString([],Ee)+" - "+re.toLocaleTimeString([],Ee)}function N(q,re){return!re||!q?"0px":Math.max(2,q/re*100)+"%"}function Y(q){const re=we.value.findIndex(Ee=>Ee._time&&Ee._time.getTime()>=q.start.getTime()&&Ee._time.getTime()=0&&d.value){const Ee=d.value.querySelectorAll(".log-line");Ee[re]&&(Ee[re].scrollIntoView({behavior:"smooth",block:"center"}),n.value=!1)}}const we=J(()=>{let q=t.value;if(a.value&&(q=q.filter(re=>(re.level||"INFO")===a.value)),x.value){const re=ao.find(Ee=>Ee.value===x.value);if(re&&re.seconds){const Ee=new Date(Date.now()-re.seconds*1e3);q=q.filter(Ze=>Ze._time&&Ze._time>=Ee)}}if(i.value&&!H.value)if(l.value)try{const re=new RegExp(i.value,"i");q=q.filter(Ee=>{const Ze=Ee.text||Ee.raw||"",lt=Ee.tool||"";return re.test(Ze)||re.test(lt)})}catch{}else{const re=i.value.toLowerCase();q=q.filter(Ee=>{const Ze=(Ee.text||Ee.raw||"").toLowerCase(),lt=(Ee.tool||"").toLowerCase();return Ze.includes(re)||lt.includes(re)})}return q});function ke(q){if(q.type==="log"&&q.line)try{const re=typeof q.line=="string"?JSON.parse(q.line):q.line,Ee=re.timestamp?new Date(re.timestamp):new Date;return{ts:Ee.toLocaleTimeString(),_time:Ee,level:re.error?"ERROR":"INFO",text:re.tool_name?`[${re.tool_name}] ${re.result_summary||""}`.trim():re.message||JSON.stringify(re),tool:re.tool_name||"",raw:null}}catch{return{ts:new Date().toLocaleTimeString(),_time:new Date,level:"INFO",text:String(q.line),tool:"",raw:String(q.line)}}if(q.payload){const re=q.payload,Ee=re.timestamp?new Date(re.timestamp):new Date;return{ts:Ee.toLocaleTimeString(),_time:Ee,level:re.error?"ERROR":"INFO",text:re.tool_name?`[${re.tool_name}] ${re.result_summary||""}`.trim():re.message||JSON.stringify(re),tool:re.tool_name||"",raw:null}}return typeof q=="string"?{ts:new Date().toLocaleTimeString(),_time:new Date,level:"INFO",text:q,tool:"",raw:q}:{ts:new Date().toLocaleTimeString(),_time:new Date,level:"INFO",text:JSON.stringify(q),tool:"",raw:null}}function ie(q){const re=ke(q);if(s.value){g.value.push(re);return}he(re)}function he(q){t.value.push(q),t.value.length>p&&(t.value=t.value.slice(-p)),n.value&&Rt(()=>F())}function F(q=!1){const re=d.value;re&&re.scrollTo({top:re.scrollHeight,behavior:q?"smooth":"instant"})}function se(){n.value=!0,u.value=!1,Rt(()=>F(!0))}const Se=new Set(["PageUp","PageDown","ArrowUp","ArrowDown","Home","End"," "]);function V(){const q=d.value;if(!q)return;const re=q.scrollHeight-q.scrollTop-q.clientHeight<40;u.value=!n.value&&!re&&t.value.length>0,ge.value&&de()}function de(){const q=d.value;!q||!n.value||q.scrollHeight-q.scrollTop-q.clientHeight>=40&&(n.value=!1,u.value=t.value.length>0)}function ce(){n.value&&requestAnimationFrame(de)}function ye(q){Se.has(q.key)&&ce()}const ge=h(!1);function He(){n.value&&(ge.value=!0,requestAnimationFrame(de))}function k(){ge.value&&(ge.value=!1,de())}function L(){n.value&&(u.value=!1,Rt(()=>F()))}function $(){if(s.value=!s.value,!s.value&&g.value.length>0){for(const q of g.value)he(q);g.value=[]}}function ee(){t.value=[],g.value=[],u.value=!1}function Z(){let q;e.value==="search"?q=Pe.value.map(lt=>{const Ot=lt.error?"ERROR":"INFO",Pt=lt.tool_name?`[${lt.tool_name}] `:"";return`${lt.timestamp||""} ${Ot} ${Pt}${lt.result_summary||lt.message||""}`}).join(` -`):q=we.value.map(lt=>`${lt.ts} ${lt.level} ${lt.text}`).join(` -`);const re=new Blob([q],{type:"text/plain"}),Ee=URL.createObjectURL(re),Ze=document.createElement("a");Ze.href=Ee,Ze.download=`odin-logs-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.txt`,Ze.click(),URL.revokeObjectURL(Ee)}function X(q,re){const Ee=`${q.ts} ${q.level} ${q.text||q.raw||""}`;navigator.clipboard.writeText(Ee).then(()=>{f.value=re,setTimeout(()=>{f.value=null},1500)}).catch(()=>{})}function ue(q){a.value=a.value===q?"":q,I.value="all"}function oe(q){return q.level==="ERROR"?"log-line-error":q.level==="WARNING"?"log-line-warning":"text-gray-300"}function le(q){return q==="ERROR"?"text-red-500 font-semibold":q==="WARNING"?"text-yellow-500":"text-blue-500"}function te(q){return q==="ERROR"?"log-chip-error":q==="WARNING"?"log-chip-warning":"log-chip-info"}function ne(q){I.value=q.id;const re=q.filters;a.value=re.level||"",x.value=re.timeRange||"",i.value=re.text||"",re.levels&&(a.value=re.levels[0]||""),re.hasToolName&&(i.value="")}function fe(q){I.value=q.id,a.value=q.filters.level||"",x.value=q.filters.timeRange||"",i.value=q.filters.text||""}function ve(){if(!S.value.trim())return;const q={id:"custom-"+Date.now(),name:S.value.trim(),filters:{level:a.value,timeRange:x.value,text:i.value}};m.value=[...m.value,q],T(),_.value=!1,S.value=""}function Te(q){m.value=m.value.filter(re=>re.id!==q),T(),I.value===q&&(I.value="all")}const Oe=h("all"),Le=h(""),De=h(""),Be=h(""),qe=h(""),ct=h(""),K=h(100),xe=Mk,Ce=h(!1),Re=h(!1),Ve=h(""),Pe=h([]),pt=h(null),ls=h(null);function Ps(){e.value="search",pt.value||nn()}async function nn(){try{pt.value=await G.get("/api/logs/stats")}catch{}}function Ss(){const q=ct.value;if(!q){Be.value="",qe.value="";return}const Ee={last_5m:300,last_15m:900,last_1h:3600,last_4h:14400,last_24h:86400,last_7d:604800}[q];if(Ee){const Ze=new Date(Date.now()-Ee*1e3);Be.value=Fs(Ze),qe.value=""}}function Fs(q){const re=Ee=>String(Ee).padStart(2,"0");return`${q.getFullYear()}-${re(q.getMonth()+1)}-${re(q.getDate())}T${re(q.getHours())}:${re(q.getMinutes())}`}function Mt(q){if(!q)return"";const re=new Date(q);return isNaN(re.getTime())?"":re.toISOString()}async function Yt(){Ce.value=!0,Ve.value="",Re.value=!0,ls.value=null;try{const q=new URLSearchParams;Oe.value&&Oe.value!=="all"&&q.set("level",Oe.value),Le.value&&q.set("tool",Le.value),De.value&&q.set("q",De.value);const re=Mt(Be.value),Ee=Mt(qe.value);re&&q.set("start",re),Ee&&q.set("end",Ee),q.set("limit",String(K.value));const Ze=await G.get(`/api/logs/search?${q.toString()}`);Pe.value=Ze.entries||[]}catch(q){Ve.value=q.message||"Search failed",Pe.value=[]}finally{Ce.value=!1}}function $s(){Oe.value="all",Le.value="",De.value="",Be.value="",qe.value="",ct.value="",K.value=100,Pe.value=[],Re.value=!1,Ve.value="",ls.value=null}function Bs(q){ls.value=ls.value===q?null:q}function An(q){if(!q.timestamp)return"";try{return new Date(q.timestamp).toLocaleString()}catch{return q.timestamp}}function Us(q){return q.type==="web_action"?`${q.status||""} (${q.execution_time_ms||0}ms)`:(q.result_summary||"").slice(0,200)}function zt(q){return q.error?"log-line-error":"text-gray-300"}function Vn(q){try{return JSON.stringify(q,null,2)}catch{return String(q)}}let Ct=null,rs=null,os=!1;function Ye(){os||(os=!0,Ke.subscribe("logs",ie),r.value=Ke.connected,o.value=Ke.state||"disconnected",Ct=Ke.onStateChange,rs=(q,re)=>{o.value=q,r.value=q==="connected",Ct&&Ct(q,re)},Ke.onStateChange=rs)}function gs(){os&&(os=!1,Ke.unsubscribe("logs",ie),Ke.onStateChange===rs&&(Ke.onStateChange=Ct),rs=null,Ct=null)}return We(()=>{w(),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k)}),Ds(Ye),Ms(gs),xt(()=>{gs(),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k)}),{mode:e,logs:t,paused:s,autoScroll:n,levelFilter:a,textFilter:i,useRegex:l,subscribed:r,wsState:o,wsStateLabel:c,logContainer:d,filteredLogs:we,pauseBuffer:g,showJumpBottom:u,copiedIndex:f,regexError:H,levels:b,logPresets:y,timeRanges:E,timeRange:x,activeLogPreset:I,customLogPresets:m,showSaveLogPreset:_,newLogPresetName:S,hasActiveLogFilters:C,timeRangeLabel:M,timelineBuckets:R,timelineMax:j,timelineSpanLabel:Q,timelineLabelSkip:U,togglePause:$,clearLogs:ee,exportLogs:Z,logLineClass:oe,levelClass:le,levelChipClass:te,toggleLevel:ue,copyLine:X,jumpToBottom:se,onScroll:V,onUserScrollIntent:ce,onUserScrollKey:ye,onAutoScrollToggle:L,onPointerDown:He,applyLogPreset:ne,applyCustomLogPreset:fe,saveLogCustomPreset:ve,removeLogCustomPreset:Te,segmentHeight:N,jumpToTimelineBucket:Y,searchLevel:Oe,searchTool:Le,searchKeyword:De,searchStart:Be,searchEnd:qe,searchTimePreset:ct,searchLimit:K,searchLimits:xe,searching:Ce,searchRan:Re,searchError:Ve,searchResults:Pe,searchStats:pt,expandedSearch:ls,switchToSearch:Ps,runSearch:Yt,clearSearchFilters:$s,toggleSearchExpand:Bs,formatSearchTs:An,searchEntryText:Us,searchLogLineClass:zt,formatJson:Vn,applySearchTimePreset:Ss}}};function _l(e=[]){const t=[],s=new Set;function n(a){const i=[a.kind,a.label,a.apply_mode||"",a.code||"",a.text||""].join("\0");s.has(i)||(s.add(i),t.push({...a,key:i}))}for(const a of e)for(const i of(a==null?void 0:a.consumers)||[])n({kind:"consumer",label:i.name,apply_mode:i.apply_mode,text:i.detail});for(const a of e)a!=null&&a.apply_handler&&n({kind:"handler",label:"Apply handler",code:a.apply_handler});for(const a of e)a!=null&&a.restart_reason&&n({kind:"restart",label:"Why a restart is required",text:a.restart_reason});for(const a of e)a!=null&&a.activation_policy&&n({kind:"activation",label:"Activation policy",text:a.activation_policy});return t}const Fk=Object.freeze([{key:"all",label:"All fields",short:"All",icon:"grid"},{key:"applied",label:"Applied",short:"Applied",icon:"success"},{key:"pending_restart",label:"Pending restart",short:"Restart",icon:"refresh"},{key:"dormant",label:"Saved, not active",short:"Saved only",icon:"pause"},{key:"invalid",label:"Invalid",short:"Invalid",icon:"error"},{key:"drift",label:"Drift",short:"Drift",icon:"warning"},{key:"unknown",label:"Effective state unknown",short:"Unknown",icon:"info"}]);function $k(e,t={}){var a,i;const s=t.getStyle||(l=>globalThis.getComputedStyle(l)),n=Object.hasOwn(t,"fallback")?t.fallback:(a=globalThis.document)==null?void 0:a.scrollingElement;for(let l=e;l;l=l.parentElement){const r=((i=s(l))==null?void 0:i.overflowY)||"";if(/^(auto|scroll|overlay)$/.test(r)&&l.scrollHeight>l.clientHeight)return l}return n&&n.scrollHeight>n.clientHeight?n:e||n||null}const Ha=[{key:"core",label:"Core",icon:"sliders",sections:["timezone","logging","permissions","graceful_degradation"]},{key:"models",label:"Models & AI",icon:"brain",sections:["image","llm_recovery"]},{key:"runtime",label:"Runtime",icon:"activity",sections:["context","sessions","agents","turn_state"]},{key:"data",label:"Data & Storage",icon:"database",sections:["learning","search","usage","audit","attachments"]},{key:"services",label:"Services",icon:"link",sections:["webhook","observability","email","browser","comfyui","slack","mcp"]},{key:"automation",label:"Automation",icon:"workflow",sections:["message_triggers","reaction_triggers","grafana_alerts","outbound_webhooks","issue_tracker"]},{key:"infrastructure",label:"Infrastructure",icon:"server",sections:["tools","web"]}],Bk={live_read:"Applies immediately",live_apply:"Dedicated live apply",live_for_new_work:"Applies to new work",restart:"Restart required",activation_required:"Saved only — see activation note",legacy_control:"Controlled elsewhere",dormant:"Saved for future support"},io=new Set(["llm_provider","openai_codex","ollama","kimi","personality","discord"]),Uk=Object.freeze(["web.api_tokens","outbound_webhooks.targets"]);function Mu(e){return Uk.some(t=>e===t||e.startsWith(`${t}.`))}const Sm="odin_config_center_expanded_v1",Tm="odin_config_center_category_v1",Hk=50,zk=650,lo=()=>G.get("/api/config/meta");function Zn(e){return e===void 0?void 0:JSON.parse(JSON.stringify(e))}function Ri(e,t){return JSON.stringify(e)===JSON.stringify(t)}function wa(e){return String(e).replace(/[_-]+/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Vk(e){return e===void 0?"unset":e===null?"null":typeof e=="boolean"?e?"Enabled":"Disabled":Array.isArray(e)?e.length?`${e.length} item${e.length===1?"":"s"}`:"Empty list":typeof e=="object"?Object.keys(e).length?`${Object.keys(e).length} field${Object.keys(e).length===1?"":"s"}`:"Empty object":e===""?"Empty":String(e)}function jk(e){if(e===void 0)return"unset";if(e===null)return"null";if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function Cm(e,t){if(Ri(e,t))return;if(!(e&&t&&typeof e=="object"&&typeof t=="object"&&!Array.isArray(e)&&!Array.isArray(t)))return Zn(t);const n={};for(const[a,i]of Object.entries(t)){const l=Cm(e[a],i);l!==void 0&&(n[a]=l)}return Object.keys(n).length?n:void 0}function qk(e,t){const s={};for(const[n,a]of Object.entries(t||{})){const i=Cm(e==null?void 0:e[n],a);i!==void 0&&(s[n]=i)}return s}function Em(e,t,s,n){if(Ri(e,t))return;if(e&&t&&typeof e=="object"&&typeof t=="object"&&!Array.isArray(e)&&!Array.isArray(t)){const i=new Set([...Object.keys(e),...Object.keys(t)]);for(const l of i)Em(e[l],t[l],s?`${s}.${l}`:l,n);return}n.push({path:s,oldVal:e,newVal:t})}function Gk(){try{const e=JSON.parse(localStorage.getItem(Sm)||"{}");return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function Kk(){try{const e=localStorage.getItem(Tm);return Ha.some(t=>t.key===e)?e:Ha[0].key}catch{return Ha[0].key}}const Wk={template:` + `,setup(){const e=h("live"),t=h([]),s=h(!1),n=h(!0),a=h(""),i=h(""),l=h(!1),r=h(!1),o=h(Ke.state||"disconnected"),c=J(()=>{switch(o.value){case"connected":return"Live";case"connecting":return"Connecting…";case"reconnecting":return"Reconnecting…";default:return"Disconnected"}}),d=h(null),u=h(!1),p=h(null),f=2e3,b=Lk,y=Dk,E=ao,O=h("all"),x=h(""),m=h([]),_=h(!1),S=h(""),g=h([]);function w(){try{const j=localStorage.getItem("odin-log-presets");j&&(m.value=JSON.parse(j))}catch{}}function T(){try{localStorage.setItem("odin-log-presets",JSON.stringify(m.value))}catch{}}const C=J(()=>a.value!==""||i.value.trim()!==""||x.value!==""),M=J(()=>{const j=ao.find(ce=>ce.value===x.value);return j?j.label:""}),H=J(()=>{if(!l.value||!i.value)return null;try{return new RegExp(i.value,"i"),null}catch(j){return j.message}}),P=24,R=J(()=>{if(Se.value.length===0)return[];const j=[],ce=new Date,Ae=3600*1e3;for(let Ze=P-1;Ze>=0;Ze--){const lt=new Date(ce.getTime()-(Ze+1)*Ae),Ot=new Date(ce.getTime()-Ze*Ae);j.push({start:lt,end:Ot,label:N(lt,Ot),shortLabel:Ot.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),total:0,info:0,warnings:0,errors:0})}for(const Ze of Se.value){if(!Ze._time)continue;const lt=Ze._time.getTime();for(const Ot of j)if(lt>=Ot.start.getTime()&<{let j=1;for(const ce of R.value)ce.total>j&&(j=ce.total);return j}),Q=J(()=>{if(R.value.length===0)return"";const j=Se.value.map(Ze=>Ze._time&&Ze._time.getTime()).filter(Boolean);if(j.length===0)return"";const ce=new Date(Math.min(...j));return`${Se.value.length} shown, oldest ${ce.toLocaleTimeString()}`}),U=J(()=>Math.ceil(P/8));function N(j,ce){const Ae={hour:"2-digit",minute:"2-digit"};return j.toLocaleTimeString([],Ae)+" - "+ce.toLocaleTimeString([],Ae)}function I(j,ce){return!ce||!j?"0px":Math.max(2,j/ce*100)+"%"}function Y(j){const ce=Se.value.findIndex(Ae=>Ae._time&&Ae._time.getTime()>=j.start.getTime()&&Ae._time.getTime()=0&&d.value){const Ae=d.value.querySelectorAll(".log-line");Ae[ce]&&(Ae[ce].scrollIntoView({behavior:"smooth",block:"center"}),n.value=!1)}}const Se=J(()=>{let j=t.value;if(a.value&&(j=j.filter(ce=>(ce.level||"INFO")===a.value)),x.value){const ce=ao.find(Ae=>Ae.value===x.value);if(ce&&ce.seconds){const Ae=new Date(Date.now()-ce.seconds*1e3);j=j.filter(Ze=>Ze._time&&Ze._time>=Ae)}}if(i.value&&!H.value)if(l.value)try{const ce=new RegExp(i.value,"i");j=j.filter(Ae=>{const Ze=Ae.text||Ae.raw||"",lt=Ae.tool||"";return ce.test(Ze)||ce.test(lt)})}catch{}else{const ce=i.value.toLowerCase();j=j.filter(Ae=>{const Ze=(Ae.text||Ae.raw||"").toLowerCase(),lt=(Ae.tool||"").toLowerCase();return Ze.includes(ce)||lt.includes(ce)})}return j});function we(j){if(j.type==="log"&&j.line)try{const ce=typeof j.line=="string"?JSON.parse(j.line):j.line,Ae=ce.timestamp?new Date(ce.timestamp):new Date;return{ts:Ae.toLocaleTimeString(),_time:Ae,level:ce.error?"ERROR":"INFO",text:ce.tool_name?`[${ce.tool_name}] ${ce.result_summary||""}`.trim():ce.message||JSON.stringify(ce),tool:ce.tool_name||"",raw:null}}catch{return{ts:new Date().toLocaleTimeString(),_time:new Date,level:"INFO",text:String(j.line),tool:"",raw:String(j.line)}}if(j.payload){const ce=j.payload,Ae=ce.timestamp?new Date(ce.timestamp):new Date;return{ts:Ae.toLocaleTimeString(),_time:Ae,level:ce.error?"ERROR":"INFO",text:ce.tool_name?`[${ce.tool_name}] ${ce.result_summary||""}`.trim():ce.message||JSON.stringify(ce),tool:ce.tool_name||"",raw:null}}return typeof j=="string"?{ts:new Date().toLocaleTimeString(),_time:new Date,level:"INFO",text:j,tool:"",raw:j}:{ts:new Date().toLocaleTimeString(),_time:new Date,level:"INFO",text:JSON.stringify(j),tool:"",raw:null}}function re(j){const ce=we(j);if(s.value){g.value.push(ce);return}he(ce)}function he(j){t.value.push(j),t.value.length>f&&(t.value=t.value.slice(-f)),n.value&&Rt(()=>se())}function se(j=!1){const ce=d.value;ce&&ce.scrollTo({top:ce.scrollHeight,behavior:j?"smooth":"instant"})}function me(){n.value=!0,u.value=!1,Rt(()=>se(!0))}const W=new Set(["PageUp","PageDown","ArrowUp","ArrowDown","Home","End"," "]);function B(){const j=d.value;if(!j)return;const ce=j.scrollHeight-j.scrollTop-j.clientHeight<40;u.value=!n.value&&!ce&&t.value.length>0,ge.value&&ie()}function ie(){const j=d.value;!j||!n.value||j.scrollHeight-j.scrollTop-j.clientHeight>=40&&(n.value=!1,u.value=t.value.length>0)}function le(){n.value&&requestAnimationFrame(ie)}function xe(j){W.has(j.key)&&le()}const ge=h(!1);function Fe(){n.value&&(ge.value=!0,requestAnimationFrame(ie))}function k(){ge.value&&(ge.value=!1,ie())}function L(){n.value&&(u.value=!1,Rt(()=>se()))}function F(){if(s.value=!s.value,!s.value&&g.value.length>0){for(const j of g.value)he(j);g.value=[]}}function ee(){t.value=[],g.value=[],u.value=!1}function Z(){let j;e.value==="search"?j=Pe.value.map(lt=>{const Ot=lt.error?"ERROR":"INFO",Pt=lt.tool_name?`[${lt.tool_name}] `:"";return`${lt.timestamp||""} ${Ot} ${Pt}${lt.result_summary||lt.message||""}`}).join(` +`):j=Se.value.map(lt=>`${lt.ts} ${lt.level} ${lt.text}`).join(` +`);const ce=new Blob([j],{type:"text/plain"}),Ae=URL.createObjectURL(ce),Ze=document.createElement("a");Ze.href=Ae,Ze.download=`odin-logs-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.txt`,Ze.click(),URL.revokeObjectURL(Ae)}function X(j,ce){const Ae=`${j.ts} ${j.level} ${j.text||j.raw||""}`;navigator.clipboard.writeText(Ae).then(()=>{p.value=ce,setTimeout(()=>{p.value=null},1500)}).catch(()=>{})}function ue(j){a.value=a.value===j?"":j,O.value="all"}function de(j){return j.level==="ERROR"?"log-line-error":j.level==="WARNING"?"log-line-warning":"text-gray-300"}function oe(j){return j==="ERROR"?"text-red-500 font-semibold":j==="WARNING"?"text-yellow-500":"text-blue-500"}function te(j){return j==="ERROR"?"log-chip-error":j==="WARNING"?"log-chip-warning":"log-chip-info"}function ne(j){O.value=j.id;const ce=j.filters;a.value=ce.level||"",x.value=ce.timeRange||"",i.value=ce.text||"",ce.levels&&(a.value=ce.levels[0]||""),ce.hasToolName&&(i.value="")}function pe(j){O.value=j.id,a.value=j.filters.level||"",x.value=j.filters.timeRange||"",i.value=j.filters.text||""}function be(){if(!S.value.trim())return;const j={id:"custom-"+Date.now(),name:S.value.trim(),filters:{level:a.value,timeRange:x.value,text:i.value}};m.value=[...m.value,j],T(),_.value=!1,S.value=""}function Te(j){m.value=m.value.filter(ce=>ce.id!==j),T(),O.value===j&&(O.value="all")}const Oe=h("all"),Le=h(""),De=h(""),Be=h(""),qe=h(""),ct=h(""),G=h(100),_e=Mk,Ce=h(!1),Re=h(!1),Ve=h(""),Pe=h([]),ft=h(null),ls=h(null);function Ps(){e.value="search",ft.value||nn()}async function nn(){try{ft.value=await q.get("/api/logs/stats")}catch{}}function Ss(){const j=ct.value;if(!j){Be.value="",qe.value="";return}const Ae={last_5m:300,last_15m:900,last_1h:3600,last_4h:14400,last_24h:86400,last_7d:604800}[j];if(Ae){const Ze=new Date(Date.now()-Ae*1e3);Be.value=Fs(Ze),qe.value=""}}function Fs(j){const ce=Ae=>String(Ae).padStart(2,"0");return`${j.getFullYear()}-${ce(j.getMonth()+1)}-${ce(j.getDate())}T${ce(j.getHours())}:${ce(j.getMinutes())}`}function Mt(j){if(!j)return"";const ce=new Date(j);return isNaN(ce.getTime())?"":ce.toISOString()}async function Yt(){Ce.value=!0,Ve.value="",Re.value=!0,ls.value=null;try{const j=new URLSearchParams;Oe.value&&Oe.value!=="all"&&j.set("level",Oe.value),Le.value&&j.set("tool",Le.value),De.value&&j.set("q",De.value);const ce=Mt(Be.value),Ae=Mt(qe.value);ce&&j.set("start",ce),Ae&&j.set("end",Ae),j.set("limit",String(G.value));const Ze=await q.get(`/api/logs/search?${j.toString()}`);Pe.value=Ze.entries||[]}catch(j){Ve.value=j.message||"Search failed",Pe.value=[]}finally{Ce.value=!1}}function $s(){Oe.value="all",Le.value="",De.value="",Be.value="",qe.value="",ct.value="",G.value=100,Pe.value=[],Re.value=!1,Ve.value="",ls.value=null}function Us(j){ls.value=ls.value===j?null:j}function An(j){if(!j.timestamp)return"";try{return new Date(j.timestamp).toLocaleString()}catch{return j.timestamp}}function Bs(j){return j.type==="web_action"?`${j.status||""} (${j.execution_time_ms||0}ms)`:(j.result_summary||"").slice(0,200)}function zt(j){return j.error?"log-line-error":"text-gray-300"}function Vn(j){try{return JSON.stringify(j,null,2)}catch{return String(j)}}let Ct=null,rs=null,os=!1;function Ye(){os||(os=!0,Ke.subscribe("logs",re),r.value=Ke.connected,o.value=Ke.state||"disconnected",Ct=Ke.onStateChange,rs=(j,ce)=>{o.value=j,r.value=j==="connected",Ct&&Ct(j,ce)},Ke.onStateChange=rs)}function gs(){os&&(os=!1,Ke.unsubscribe("logs",re),Ke.onStateChange===rs&&(Ke.onStateChange=Ct),rs=null,Ct=null)}return We(()=>{w(),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k)}),Ds(Ye),Ms(gs),xt(()=>{gs(),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k)}),{mode:e,logs:t,paused:s,autoScroll:n,levelFilter:a,textFilter:i,useRegex:l,subscribed:r,wsState:o,wsStateLabel:c,logContainer:d,filteredLogs:Se,pauseBuffer:g,showJumpBottom:u,copiedIndex:p,regexError:H,levels:b,logPresets:y,timeRanges:E,timeRange:x,activeLogPreset:O,customLogPresets:m,showSaveLogPreset:_,newLogPresetName:S,hasActiveLogFilters:C,timeRangeLabel:M,timelineBuckets:R,timelineMax:V,timelineSpanLabel:Q,timelineLabelSkip:U,togglePause:F,clearLogs:ee,exportLogs:Z,logLineClass:de,levelClass:oe,levelChipClass:te,toggleLevel:ue,copyLine:X,jumpToBottom:me,onScroll:B,onUserScrollIntent:le,onUserScrollKey:xe,onAutoScrollToggle:L,onPointerDown:Fe,applyLogPreset:ne,applyCustomLogPreset:pe,saveLogCustomPreset:be,removeLogCustomPreset:Te,segmentHeight:I,jumpToTimelineBucket:Y,searchLevel:Oe,searchTool:Le,searchKeyword:De,searchStart:Be,searchEnd:qe,searchTimePreset:ct,searchLimit:G,searchLimits:_e,searching:Ce,searchRan:Re,searchError:Ve,searchResults:Pe,searchStats:ft,expandedSearch:ls,switchToSearch:Ps,runSearch:Yt,clearSearchFilters:$s,toggleSearchExpand:Us,formatSearchTs:An,searchEntryText:Bs,searchLogLineClass:zt,formatJson:Vn,applySearchTimePreset:Ss}}};function _l(e=[]){const t=[],s=new Set;function n(a){const i=[a.kind,a.label,a.apply_mode||"",a.code||"",a.text||""].join("\0");s.has(i)||(s.add(i),t.push({...a,key:i}))}for(const a of e)for(const i of(a==null?void 0:a.consumers)||[])n({kind:"consumer",label:i.name,apply_mode:i.apply_mode,text:i.detail});for(const a of e)a!=null&&a.apply_handler&&n({kind:"handler",label:"Apply handler",code:a.apply_handler});for(const a of e)a!=null&&a.restart_reason&&n({kind:"restart",label:"Why a restart is required",text:a.restart_reason});for(const a of e)a!=null&&a.activation_policy&&n({kind:"activation",label:"Activation policy",text:a.activation_policy});return t}const Fk=Object.freeze([{key:"all",label:"All fields",short:"All",icon:"grid"},{key:"applied",label:"Applied",short:"Applied",icon:"success"},{key:"pending_restart",label:"Pending restart",short:"Restart",icon:"refresh"},{key:"dormant",label:"Saved, not active",short:"Saved only",icon:"pause"},{key:"invalid",label:"Invalid",short:"Invalid",icon:"error"},{key:"drift",label:"Drift",short:"Drift",icon:"warning"},{key:"unknown",label:"Effective state unknown",short:"Unknown",icon:"info"}]);function $k(e,t={}){var a,i;const s=t.getStyle||(l=>globalThis.getComputedStyle(l)),n=Object.hasOwn(t,"fallback")?t.fallback:(a=globalThis.document)==null?void 0:a.scrollingElement;for(let l=e;l;l=l.parentElement){const r=((i=s(l))==null?void 0:i.overflowY)||"";if(/^(auto|scroll|overlay)$/.test(r)&&l.scrollHeight>l.clientHeight)return l}return n&&n.scrollHeight>n.clientHeight?n:e||n||null}const Ha=[{key:"core",label:"Core",icon:"sliders",sections:["timezone","logging","permissions","graceful_degradation"]},{key:"models",label:"Models & AI",icon:"brain",sections:["image","llm_recovery"]},{key:"runtime",label:"Runtime",icon:"activity",sections:["context","sessions","agents","turn_state"]},{key:"data",label:"Data & Storage",icon:"database",sections:["learning","search","usage","audit","attachments"]},{key:"services",label:"Services",icon:"link",sections:["webhook","observability","email","browser","comfyui","slack","mcp"]},{key:"automation",label:"Automation",icon:"workflow",sections:["message_triggers","reaction_triggers","grafana_alerts","outbound_webhooks","issue_tracker"]},{key:"infrastructure",label:"Infrastructure",icon:"server",sections:["tools","web"]}],Uk={live_read:"Applies immediately",live_apply:"Dedicated live apply",live_for_new_work:"Applies to new work",restart:"Restart required",activation_required:"Saved only — see activation note",legacy_control:"Controlled elsewhere",dormant:"Saved for future support"},io=new Set(["llm_provider","openai_codex","ollama","kimi","personality","discord"]),Bk=Object.freeze(["web.api_tokens","outbound_webhooks.targets"]);function Mu(e){return Bk.some(t=>e===t||e.startsWith(`${t}.`))}const Sm="odin_config_center_expanded_v1",Tm="odin_config_center_category_v1",Hk=50,zk=650,lo=()=>q.get("/api/config/meta");function Zn(e){return e===void 0?void 0:JSON.parse(JSON.stringify(e))}function Ri(e,t){return JSON.stringify(e)===JSON.stringify(t)}function wa(e){return String(e).replace(/[_-]+/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Vk(e){return e===void 0?"unset":e===null?"null":typeof e=="boolean"?e?"Enabled":"Disabled":Array.isArray(e)?e.length?`${e.length} item${e.length===1?"":"s"}`:"Empty list":typeof e=="object"?Object.keys(e).length?`${Object.keys(e).length} field${Object.keys(e).length===1?"":"s"}`:"Empty object":e===""?"Empty":String(e)}function jk(e){if(e===void 0)return"unset";if(e===null)return"null";if(typeof e=="object")try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function Cm(e,t){if(Ri(e,t))return;if(!(e&&t&&typeof e=="object"&&typeof t=="object"&&!Array.isArray(e)&&!Array.isArray(t)))return Zn(t);const n={};for(const[a,i]of Object.entries(t)){const l=Cm(e[a],i);l!==void 0&&(n[a]=l)}return Object.keys(n).length?n:void 0}function qk(e,t){const s={};for(const[n,a]of Object.entries(t||{})){const i=Cm(e==null?void 0:e[n],a);i!==void 0&&(s[n]=i)}return s}function Em(e,t,s,n){if(Ri(e,t))return;if(e&&t&&typeof e=="object"&&typeof t=="object"&&!Array.isArray(e)&&!Array.isArray(t)){const i=new Set([...Object.keys(e),...Object.keys(t)]);for(const l of i)Em(e[l],t[l],s?`${s}.${l}`:l,n);return}n.push({path:s,oldVal:e,newVal:t})}function Gk(){try{const e=JSON.parse(localStorage.getItem(Sm)||"{}");return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function Kk(){try{const e=localStorage.getItem(Tm);return Ha.some(t=>t.key===e)?e:Ha[0].key}catch{return Ha[0].key}}const Wk={template:`
@@ -4157,7 +4180,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(null),t=h(null),s=h(!0),n=h(null),a=h(!1),i=h(null),l=h(null),r=h(null),o=h(!1),c=h(!1),d=h(null),u=h(""),f=h("all"),p=h(Kk()),b=h(Gk()),y=h({}),E=h({}),I=h(""),x=h({}),m=h({}),_=h([]),S=h([]),g=h(!1),w=h(!1),T=h(!1);let C=null,M=null,H={path:null,at:0},P=0;const R=J(()=>{var v;return(((v=t.value)==null?void 0:v.fields)||[]).filter(D=>!io.has(D.path.split(".")[0])&&!Mu(D.path))}),j=J(()=>new Map(R.value.map(v=>[v.path,v]))),Q=J(()=>we.value.reduce((v,D)=>v+D.sections.length,0)),U=J(()=>R.value.length),O=J(()=>Fk),N=J(()=>_.value.length>0),Y=J(()=>S.value.length>0),we=J(()=>{if(!e.value)return[];const v=new Set(Ha.flatMap(ae=>ae.sections)),D=Ha.map(ae=>({...ae,sections:ae.sections.filter(Ne=>Object.hasOwn(e.value,Ne)&&!io.has(Ne))})).filter(ae=>ae.sections.length),B=Object.keys(e.value).filter(ae=>!v.has(ae)&&!io.has(ae));return B.length&&D.push({key:"other",label:"Other",icon:"folder",sections:B}),D}),ke=J(()=>e.value?{...e.value,...y.value}:null),ie=J(()=>{if(!e.value)return[];const v=[];for(const[D,B]of Object.entries(y.value))Em(e.value[D],B,D,v);return v.filter(D=>!Ri(D.oldVal,D.newVal)).map(D=>{const B=L(D.path);return{...D,label:(B==null?void 0:B.label)||wa(D.path.split(".").at(-1)),apply_mode:(B==null?void 0:B.apply_mode)||ue(D.path.split(".")[0])}})}),he=J(()=>ie.value.length>0),F=J(()=>ie.value.length),se=J(()=>new Set(ie.value.map(v=>v.path.split(".")[0])).size),Se=J(()=>!!u.value||f.value!=="all"),V=J(()=>{const v={...m.value};for(const D of ie.value){const B=L(D.path),ae=Ot(B,D.newVal);ae&&(v[D.path]=ae)}return v}),de=J(()=>Object.keys(V.value).length>0),ce=J(()=>e.value?(Se.value?we.value:we.value.filter(D=>D.key===p.value)).map(D=>({...D,sections:D.sections.filter(B=>K(B))})).filter(D=>D.sections.length):[]),ye=J(()=>{const v=["live_read","live_apply","live_for_new_work","restart","activation_required","legacy_control","dormant"],D=new Map(v.map(B=>[B,[]]));for(const B of ie.value){const ae=D.has(B.apply_mode)?B.apply_mode:"restart";D.get(ae).push(B)}return v.filter(B=>D.get(B).length).map(B=>({key:B,label:Gs(B),entries:D.get(B)}))}),ge=J(()=>ie.value.filter(v=>v.apply_mode==="restart").length),He=J(()=>R.value.filter(v=>v.pending_restart)),k=J(()=>He.value.length);function L(v){const D=j.value.get(v);return D?{...D,apply_details:_l([D])}:null}function $(v){const D=`${v}.`;return R.value.filter(B=>B.path===v||B.path.startsWith(D))}function ee(v){return $(v).length}function Z(v){return wa(v)}function X(v){const D=$(v);if(!D.length)return`${wa(v)} configuration.`;const B=D.find(Ue=>Ue.sensitivity==="public"&&Ue.description)||D.find(Ue=>Ue.description),ae=(B==null?void 0:B.description)||"";return ae.match(/setting for (.+)\.$/i)?`${wa(v)} settings and runtime behaviour.`:ae}function ue(v){const D=[...new Set($(v).map(B=>B.apply_mode))];return D.length===1?D[0]:D.includes("restart")?"restart":D.includes("activation_required")?"activation_required":D[0]||"restart"}function oe(v){const D=[...new Set($(v).map(B=>Gs(B.apply_mode)))];return D.length?D.length===1?D[0]:`Mixed apply behaviour: ${D.join(" · ")}`:""}function le(v){return _l($(v))}function te(v,D){return D.split(".").reduce((B,ae)=>B==null?void 0:B[ae],v)}function ne(v){const D=ke.value;return $(v).filter(B=>Mu(B.path)?!1:B.path.split(".").length<=2?!0:!B.path.includes(".*")).map(B=>({...B,key:B.path.split(".").at(-1),value:te(D,B.path),apply_details:_l([B]),editor:B.path==="agents.final_warning_iterations"?"warning-chips":null}))}function fe(v){const D=v.path.split(".");return D.length>2?D.slice(0,2).join("."):null}function ve(v){const D=new Map;for(const B of ne(v)){const ae=fe(B),Ne=ae||`${v}.__root`;D.has(Ne)||D.set(Ne,{key:Ne,path:ae,entries:[]}),D.get(Ne).entries.push(B)}return[...D.values()].map(B=>{const ae=B.entries.find(Ne=>Ne.group_description);return{...B,label:B.path?wa(B.path.split(".").at(-1)):null,description:(ae==null?void 0:ae.group_description)||null,apply_details:_l(B.entries),runtime_summaries:Oe(B.entries)}})}function Te(v){return{save:v.save_effect||(v.apply_mode==="dormant"?"Saving records this value in config.yml.":"Saving records this value and validates the section."),runtime:v.runtime_effect||{live_read:"Odin reads the saved value during current work.",live_apply:"Odin reloads this setting without a restart.",live_for_new_work:"New work uses the saved value; existing work keeps its snapshot.",restart:"Odin keeps using its startup value until a clean restart.",activation_required:"Odin keeps the current behavior until you enable this feature separately.",legacy_control:"Odin keeps the existing compatibility behavior until you apply this choice.",dormant:"This version of Odin does not use the saved value. Restarting will not activate it."}[v.apply_mode]||"Effective runtime state is not currently observable."}}function Oe(v){const D=new Map;for(const B of v){const ae=Te(B),Ne=`${B.apply_mode}|${ae.save}|${ae.runtime}`;D.has(Ne)||D.set(Ne,{key:Ne,label:Gs(B.apply_mode),save:ae.save,runtime:ae.runtime})}return[...D.values()]}function Le(v){if(De(v))return v.runtime_effect||v.activation_policy||"";if(v.apply_mode==="activation_required"){const D=v.activation_policy||v.runtime_effect;return D?`Not active after saving. No activation control exists in this release. ${D}`:"Not active after saving; no activation control exists in this release."}return""}function De(v){return v.action_available===!0&&!!(v.action_label&&v.action_endpoint)}async function Be(v){if(De(v))try{if(Pe(v.path))throw new Error("Save this setting before applying its action.");const D=String(v.action_method||"POST").toLowerCase(),B={post:G.post.bind(G),put:G.put.bind(G),delete:G.del.bind(G)}[D];if(!B)throw new Error("Unsupported configuration action");await B(v.action_endpoint,v.action_body||void 0),await me(),Cs("success",`${v.action_label} completed.`)}catch(D){Cs("error",D.message||`${v.action_label} failed`)}}function qe(v,D){return[v.label,v.path,v.description,...v.aliases||[]].filter(Boolean).join(" ").toLowerCase().includes(D)}function ct(v){const D=u.value.trim().toLowerCase();return D?$(v).filter(B=>qe(B,D)):[]}function K(v){const D=$(v);if(f.value!=="all"&&!D.some(ae=>ae.apply_state===f.value))return!1;const B=u.value.trim().toLowerCase();return!B||`${Z(v)} ${v}`.toLowerCase().includes(B)?!0:D.some(ae=>qe(ae,B))}function xe(v,D){return $(v).filter(B=>B.apply_state===D).length}function Ce(v){return v==="all"?U.value:R.value.filter(D=>D.apply_state===v).length}function Re(v){const D=v.sections.flatMap(B=>$(B));return{fields:D.length,modified:ie.value.filter(B=>v.sections.includes(B.path.split(".")[0])).length,pending_restart:D.filter(B=>B.apply_state==="pending_restart").length,invalid:D.filter(B=>B.apply_state==="invalid").length,dormant:D.filter(B=>B.apply_state==="dormant").length}}function Ve(v){var D;return Object.hasOwn(y.value,v)&&!Ri((D=e.value)==null?void 0:D[v],y.value[v])}function Pe(v){return ie.value.some(D=>D.path===v||D.path.startsWith(`${v}.`))}function pt(v){p.value=v,u.value="",f.value="all";try{localStorage.setItem(Tm,v)}catch{}}function ls(v){f.value=v}function Ps(){u.value="",f.value="all"}function nn(v){var D;return((D=we.value.find(B=>B.sections.includes(v)))==null?void 0:D.sections)||[]}function Ss(v){const D=nn(v),B=D.find(ae=>b.value[ae]===!0);return B||D.find(ae=>b.value[ae]!==!1)||null}function Fs(v){return u.value&&!T.value&&K(v)?!0:T.value?Ss(v)===v:Object.hasOwn(b.value,v)?b.value[v]===!0:!0}function Mt(v){const D=!Fs(v);if(T.value){const B={...b.value};for(const ae of nn(v))B[ae]===!0&&(B[ae]=!1);B[v]=D,b.value=B;return}b.value={...b.value,[v]:D}}function Yt(){_.value.push(Zn(y.value)),_.value.length>Hk&&_.value.shift(),S.value=[]}function $s(){he.value&&(Yt(),y.value={},m.value={},g.value=!1)}function Bs(v,D=!1){const B=Date.now();if(D&&H.path===v&&B-H.atNe-ae);I.value="",zt(v,B)}function q(v,D){zt(v,(v.value||[]).filter(B=>B!==D))}function re(v){return v.apply_mode==="live_read"?"Odin reads the saved file value on next use.":v.apply_mode==="live_for_new_work"?"New work uses the saved file value.":v.apply_mode==="live_apply"?v.apply_handler?`Apply the saved value through ${v.apply_handler}.`:"Apply it through its dedicated owner page or endpoint.":v.apply_mode==="restart"?"Restart Odin for the saved collection to take effect.":v.apply_mode==="activation_required"?"Saving does not enable it. No activation control exists in this release.":v.apply_mode==="dormant"?"This release does not use the saved collection.":"Follow the runtime details shown for this setting."}function Ee(v){return v.type==="array"&&Array.isArray(v.value)&&!v.structured_container&&!v.structured_container_child&&v.sensitivity==="public"&&v.value.every(D=>["string","number","boolean"].includes(typeof D))}function Ze(v){const D=String(x.value[v.path]??"").trim();if(!D)return;const B=[...new Set([...v.value||[],D])];x.value={...x.value,[v.path]:""},zt(v,B)}function lt(v,D){zt(v,(v.value||[]).filter(B=>B!==D))}function Ot(v,D){var ae;if(!v)return null;if((ae=v.enum)!=null&&ae.length&&!v.enum.includes(D))return`Choose one of: ${v.enum.join(", ")}`;if(v.path==="agents.final_warning_iterations"&&(!Array.isArray(D)||!D.length))return"Add at least one warning threshold.";const B=v.constraints||{};if((v.type==="integer"||v.type==="number")&&typeof D=="number"){if(B.minimum!==void 0&&DB.maximum)return`Must be at most ${B.maximum}${v.unit?` ${v.unit}`:""}`}return null}function Pt(v){return V.value[v.path]||null}function ma(v){const D=`${v}.`;return Object.keys(V.value).some(B=>B===v||B.startsWith(D))}function Ts(){_.value.length&&(S.value.push(Zn(y.value)),y.value=_.value.pop(),m.value={},E.value={},H={path:null,at:0})}function ga(){S.value.length&&(_.value.push(Zn(y.value)),y.value=S.value.pop(),m.value={},E.value={},H={path:null,at:0})}function ni(){!he.value||de.value||(g.value=!0,w.value=!1)}function va(){g.value=!1}function ba(){$s()}function Gs(v){return Bk[v]||wa(v||"unknown")}function z(v){return`apply-${String(v||"unknown").replaceAll("_","-")}`}function pe(v){return`cfgc-field-${v.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function _e(v){return`${pe(v)}-input`}function Nt(v){const D=document.getElementById(pe(v))||document.getElementById(pe(v.split(".").slice(0,2).join(".")));D==null||D.scrollIntoView({behavior:"smooth",block:"center"})}function Cs(v,D){l.value={type:v,message:D},window.setTimeout(()=>{var B;((B=l.value)==null?void 0:B.message)===D&&(l.value=null)},3500)}function jn(){o.value=!1,f.value="pending_restart",u.value="";const v=$k(n.value);v&&(v.scrollTop=0)}function Br(){o.value=!1}function ai(v=1800){M&&window.clearTimeout(M),M=window.setTimeout(rl,v)}async function rl(){if(c.value){if(P+=1,P>45){c.value=!1,d.value="Odin did not return with the new startup settings within 90 seconds.";return}try{if(t.value=await lo(),k.value===0){c.value=!1,d.value=null,Cs("success","Odin restarted and the saved startup settings are active.");return}}catch{}ai(2e3)}}async function ya(){if(!c.value){d.value=null;try{await G.post("/api/restart",{}),c.value=!0,P=0,o.value=!1,ai()}catch(v){d.value=v.message||"Odin could not schedule a restart."}}}async function ii(){if(!(!he.value||de.value||a.value)){a.value=!0;try{const v=qk(e.value,y.value),D=await G.put("/api/config",v);e.value=D,y.value={},_.value=[],S.value=[],m.value={},g.value=!1;try{t.value=await lo(),r.value=null,o.value=k.value>0,Cs("success",k.value?`Configuration saved. ${k.value} setting${k.value===1?"":"s"} still use startup values.`:"Configuration saved. Apply status has been refreshed.")}catch(B){r.value=B.message||"Unknown metadata error.",Cs("error",`Configuration saved, but apply status could not be refreshed: ${r.value}`)}}catch(v){Cs("error",v.message||"Configuration could not be saved")}finally{a.value=!1}}}async function me(){var v,D;if(!he.value){s.value=!0,i.value=null;try{const B=await G.get("/api/config"),ae=await lo();e.value=B,t.value=ae,r.value=null;const Ne=we.value;if(Ne.some(Ue=>Ue.key===p.value)||(p.value=((v=Ne[0])==null?void 0:v.key)||Ha[0].key),T.value){const et=(((D=Ne.find(Vt=>Vt.key===p.value))==null?void 0:D.sections)||[]).find(Vt=>b.value[Vt]===!0);b.value=et?{...b.value,[et]:!0}:{}}}catch(B){i.value=B.message||"Unknown configuration error"}finally{s.value=!1}}}function A(v){if(g.value||!(v.ctrlKey||v.metaKey))return;const D=v.target;D instanceof HTMLElement&&(D.matches("input, textarea, select")||D.isContentEditable)||(!v.shiftKey&&v.key.toLowerCase()==="z"?(v.preventDefault(),Ts()):(v.key.toLowerCase()==="y"||v.shiftKey&&v.key.toLowerCase()==="z")&&(v.preventDefault(),ga()))}function W(v){T.value=v.matches}return ns(b,v=>{try{localStorage.setItem(Sm,JSON.stringify(v))}catch{}},{deep:!0}),We(()=>{var v;me(),document.addEventListener("keydown",A),C=window.matchMedia("(max-width: 760px)"),W(C),(v=C.addEventListener)==null||v.call(C,"change",W)}),xt(()=>{var v;document.removeEventListener("keydown",A),(v=C==null?void 0:C.removeEventListener)==null||v.call(C,"change",W),M&&window.clearTimeout(M)}),{config:e,meta:t,loading:s,saving:a,error:i,toast:l,metaRefreshError:r,restartPromptOpen:o,restartScheduled:c,restartError:d,configMain:n,searchQuery:u,healthFilter:f,activeCategory:p,reviewOpen:g,mobileOverflowOpen:w,warningThresholdInput:I,arrayInputs:x,healthFilters:O,visibleCategories:we,displayGroups:ce,reviewGroups:ye,sectionCount:Q,fieldCount:U,hasChanges:he,changeCount:F,changedSectionCount:se,hasDraftErrors:de,canUndo:N,canRedo:Y,globalFilterActive:Se,reviewRestartCount:ge,pendingRestartCount:k,pendingRestartFields:He,healthCount:Ce,categoryStats:Re,selectCategory:pt,selectHealthFilter:ls,clearFilters:Ps,sectionLabel:Z,sectionDescription:X,sectionFieldCount:ee,sectionHealthCount:xe,sectionApplySummary:oe,sectionApplyDetails:le,sectionEntries:ne,fieldGroups:ve,sectionSearchHits:ct,fieldRuntimeCopy:Te,fieldSpecificRuntimeNote:Le,hasHonestAction:De,runFieldAction:Be,sectionChanged:Ve,fieldChanged:Pe,isSectionExpanded:Fs,toggleSection:Mt,discardAllDrafts:$s,setFieldValue:zt,setNumberFieldValue:Ye,numberInputValue:os,beginInputEdit:Vn,endTextInputEdit:Ct,endInputEdit:rs,addWarningThreshold:gs,removeWarningThreshold:q,isScalarArray:Ee,addScalarArrayItem:Ze,removeScalarArrayItem:lt,fieldError:Pt,sectionHasErrors:ma,undo:Ts,redo:ga,openReview:ni,closeReview:va,mobileCancel:ba,applyModeLabel:Gs,applyClass:z,compactValue:Vk,formatValue:jk,structuredApplyCopy:re,fieldId:pe,fieldInputId:_e,focusField:Nt,fetchConfig:me,saveConfig:ii,restartOdin:ya,restartLater:Br,reviewPendingRestart:jn}}},Zk=/^\d{15,25}$/;function Am(e){return String((e==null?void 0:e.display_name)||(e==null?void 0:e.username)||(e==null?void 0:e.id)||"Unknown user")}const Rm={props:{members:{type:Array,default:()=>[]},excludedIds:{type:Array,default:()=>[]},placeholder:{type:String,default:"Search Discord users…"},ariaLabel:{type:String,default:"Search Discord users"},optionsId:{type:String,required:!0},autofocus:{type:Boolean,default:!1}},emits:["select"],template:` + `,setup(){const e=h(null),t=h(null),s=h(!0),n=h(null),a=h(!1),i=h(null),l=h(null),r=h(null),o=h(!1),c=h(!1),d=h(null),u=h(""),p=h("all"),f=h(Kk()),b=h(Gk()),y=h({}),E=h({}),O=h(""),x=h({}),m=h({}),_=h([]),S=h([]),g=h(!1),w=h(!1),T=h(!1);let C=null,M=null,H={path:null,at:0},P=0;const R=J(()=>{var v;return(((v=t.value)==null?void 0:v.fields)||[]).filter(D=>!io.has(D.path.split(".")[0])&&!Mu(D.path))}),V=J(()=>new Map(R.value.map(v=>[v.path,v]))),Q=J(()=>Se.value.reduce((v,D)=>v+D.sections.length,0)),U=J(()=>R.value.length),N=J(()=>Fk),I=J(()=>_.value.length>0),Y=J(()=>S.value.length>0),Se=J(()=>{if(!e.value)return[];const v=new Set(Ha.flatMap(ae=>ae.sections)),D=Ha.map(ae=>({...ae,sections:ae.sections.filter(Ne=>Object.hasOwn(e.value,Ne)&&!io.has(Ne))})).filter(ae=>ae.sections.length),$=Object.keys(e.value).filter(ae=>!v.has(ae)&&!io.has(ae));return $.length&&D.push({key:"other",label:"Other",icon:"folder",sections:$}),D}),we=J(()=>e.value?{...e.value,...y.value}:null),re=J(()=>{if(!e.value)return[];const v=[];for(const[D,$]of Object.entries(y.value))Em(e.value[D],$,D,v);return v.filter(D=>!Ri(D.oldVal,D.newVal)).map(D=>{const $=L(D.path);return{...D,label:($==null?void 0:$.label)||wa(D.path.split(".").at(-1)),apply_mode:($==null?void 0:$.apply_mode)||ue(D.path.split(".")[0])}})}),he=J(()=>re.value.length>0),se=J(()=>re.value.length),me=J(()=>new Set(re.value.map(v=>v.path.split(".")[0])).size),W=J(()=>!!u.value||p.value!=="all"),B=J(()=>{const v={...m.value};for(const D of re.value){const $=L(D.path),ae=Ot($,D.newVal);ae&&(v[D.path]=ae)}return v}),ie=J(()=>Object.keys(B.value).length>0),le=J(()=>e.value?(W.value?Se.value:Se.value.filter(D=>D.key===f.value)).map(D=>({...D,sections:D.sections.filter($=>G($))})).filter(D=>D.sections.length):[]),xe=J(()=>{const v=["live_read","live_apply","live_for_new_work","restart","activation_required","legacy_control","dormant"],D=new Map(v.map($=>[$,[]]));for(const $ of re.value){const ae=D.has($.apply_mode)?$.apply_mode:"restart";D.get(ae).push($)}return v.filter($=>D.get($).length).map($=>({key:$,label:Gs($),entries:D.get($)}))}),ge=J(()=>re.value.filter(v=>v.apply_mode==="restart").length),Fe=J(()=>R.value.filter(v=>v.pending_restart)),k=J(()=>Fe.value.length);function L(v){const D=V.value.get(v);return D?{...D,apply_details:_l([D])}:null}function F(v){const D=`${v}.`;return R.value.filter($=>$.path===v||$.path.startsWith(D))}function ee(v){return F(v).length}function Z(v){return wa(v)}function X(v){const D=F(v);if(!D.length)return`${wa(v)} configuration.`;const $=D.find(He=>He.sensitivity==="public"&&He.description)||D.find(He=>He.description),ae=($==null?void 0:$.description)||"";return ae.match(/setting for (.+)\.$/i)?`${wa(v)} settings and runtime behaviour.`:ae}function ue(v){const D=[...new Set(F(v).map($=>$.apply_mode))];return D.length===1?D[0]:D.includes("restart")?"restart":D.includes("activation_required")?"activation_required":D[0]||"restart"}function de(v){const D=[...new Set(F(v).map($=>Gs($.apply_mode)))];return D.length?D.length===1?D[0]:`Mixed apply behaviour: ${D.join(" · ")}`:""}function oe(v){return _l(F(v))}function te(v,D){return D.split(".").reduce(($,ae)=>$==null?void 0:$[ae],v)}function ne(v){const D=we.value;return F(v).filter($=>Mu($.path)?!1:$.path.split(".").length<=2?!0:!$.path.includes(".*")).map($=>({...$,key:$.path.split(".").at(-1),value:te(D,$.path),apply_details:_l([$]),editor:$.path==="agents.final_warning_iterations"?"warning-chips":null}))}function pe(v){const D=v.path.split(".");return D.length>2?D.slice(0,2).join("."):null}function be(v){const D=new Map;for(const $ of ne(v)){const ae=pe($),Ne=ae||`${v}.__root`;D.has(Ne)||D.set(Ne,{key:Ne,path:ae,entries:[]}),D.get(Ne).entries.push($)}return[...D.values()].map($=>{const ae=$.entries.find(Ne=>Ne.group_description);return{...$,label:$.path?wa($.path.split(".").at(-1)):null,description:(ae==null?void 0:ae.group_description)||null,apply_details:_l($.entries),runtime_summaries:Oe($.entries)}})}function Te(v){return{save:v.save_effect||(v.apply_mode==="dormant"?"Saving records this value in config.yml.":"Saving records this value and validates the section."),runtime:v.runtime_effect||{live_read:"Odin reads the saved value during current work.",live_apply:"Odin reloads this setting without a restart.",live_for_new_work:"New work uses the saved value; existing work keeps its snapshot.",restart:"Odin keeps using its startup value until a clean restart.",activation_required:"Odin keeps the current behavior until you enable this feature separately.",legacy_control:"Odin keeps the existing compatibility behavior until you apply this choice.",dormant:"This version of Odin does not use the saved value. Restarting will not activate it."}[v.apply_mode]||"Effective runtime state is not currently observable."}}function Oe(v){const D=new Map;for(const $ of v){const ae=Te($),Ne=`${$.apply_mode}|${ae.save}|${ae.runtime}`;D.has(Ne)||D.set(Ne,{key:Ne,label:Gs($.apply_mode),save:ae.save,runtime:ae.runtime})}return[...D.values()]}function Le(v){if(De(v))return v.runtime_effect||v.activation_policy||"";if(v.apply_mode==="activation_required"){const D=v.activation_policy||v.runtime_effect;return D?`Not active after saving. No activation control exists in this release. ${D}`:"Not active after saving; no activation control exists in this release."}return""}function De(v){return v.action_available===!0&&!!(v.action_label&&v.action_endpoint)}async function Be(v){if(De(v))try{if(Pe(v.path))throw new Error("Save this setting before applying its action.");const D=String(v.action_method||"POST").toLowerCase(),$={post:q.post.bind(q),put:q.put.bind(q),delete:q.del.bind(q)}[D];if(!$)throw new Error("Unsupported configuration action");await $(v.action_endpoint,v.action_body||void 0),await ve(),Cs("success",`${v.action_label} completed.`)}catch(D){Cs("error",D.message||`${v.action_label} failed`)}}function qe(v,D){return[v.label,v.path,v.description,...v.aliases||[]].filter(Boolean).join(" ").toLowerCase().includes(D)}function ct(v){const D=u.value.trim().toLowerCase();return D?F(v).filter($=>qe($,D)):[]}function G(v){const D=F(v);if(p.value!=="all"&&!D.some(ae=>ae.apply_state===p.value))return!1;const $=u.value.trim().toLowerCase();return!$||`${Z(v)} ${v}`.toLowerCase().includes($)?!0:D.some(ae=>qe(ae,$))}function _e(v,D){return F(v).filter($=>$.apply_state===D).length}function Ce(v){return v==="all"?U.value:R.value.filter(D=>D.apply_state===v).length}function Re(v){const D=v.sections.flatMap($=>F($));return{fields:D.length,modified:re.value.filter($=>v.sections.includes($.path.split(".")[0])).length,pending_restart:D.filter($=>$.apply_state==="pending_restart").length,invalid:D.filter($=>$.apply_state==="invalid").length,dormant:D.filter($=>$.apply_state==="dormant").length}}function Ve(v){var D;return Object.hasOwn(y.value,v)&&!Ri((D=e.value)==null?void 0:D[v],y.value[v])}function Pe(v){return re.value.some(D=>D.path===v||D.path.startsWith(`${v}.`))}function ft(v){f.value=v,u.value="",p.value="all";try{localStorage.setItem(Tm,v)}catch{}}function ls(v){p.value=v}function Ps(){u.value="",p.value="all"}function nn(v){var D;return((D=Se.value.find($=>$.sections.includes(v)))==null?void 0:D.sections)||[]}function Ss(v){const D=nn(v),$=D.find(ae=>b.value[ae]===!0);return $||D.find(ae=>b.value[ae]!==!1)||null}function Fs(v){return u.value&&!T.value&&G(v)?!0:T.value?Ss(v)===v:Object.hasOwn(b.value,v)?b.value[v]===!0:!0}function Mt(v){const D=!Fs(v);if(T.value){const $={...b.value};for(const ae of nn(v))$[ae]===!0&&($[ae]=!1);$[v]=D,b.value=$;return}b.value={...b.value,[v]:D}}function Yt(){_.value.push(Zn(y.value)),_.value.length>Hk&&_.value.shift(),S.value=[]}function $s(){he.value&&(Yt(),y.value={},m.value={},g.value=!1)}function Us(v,D=!1){const $=Date.now();if(D&&H.path===v&&$-H.atNe-ae);O.value="",zt(v,$)}function j(v,D){zt(v,(v.value||[]).filter($=>$!==D))}function ce(v){return v.apply_mode==="live_read"?"Odin reads the saved file value on next use.":v.apply_mode==="live_for_new_work"?"New work uses the saved file value.":v.apply_mode==="live_apply"?v.apply_handler?`Apply the saved value through ${v.apply_handler}.`:"Apply it through its dedicated owner page or endpoint.":v.apply_mode==="restart"?"Restart Odin for the saved collection to take effect.":v.apply_mode==="activation_required"?"Saving does not enable it. No activation control exists in this release.":v.apply_mode==="dormant"?"This release does not use the saved collection.":"Follow the runtime details shown for this setting."}function Ae(v){return v.type==="array"&&Array.isArray(v.value)&&!v.structured_container&&!v.structured_container_child&&v.sensitivity==="public"&&v.value.every(D=>["string","number","boolean"].includes(typeof D))}function Ze(v){const D=String(x.value[v.path]??"").trim();if(!D)return;const $=[...new Set([...v.value||[],D])];x.value={...x.value,[v.path]:""},zt(v,$)}function lt(v,D){zt(v,(v.value||[]).filter($=>$!==D))}function Ot(v,D){var ae;if(!v)return null;if((ae=v.enum)!=null&&ae.length&&!v.enum.includes(D))return`Choose one of: ${v.enum.join(", ")}`;if(v.path==="agents.final_warning_iterations"&&(!Array.isArray(D)||!D.length))return"Add at least one warning threshold.";const $=v.constraints||{};if((v.type==="integer"||v.type==="number")&&typeof D=="number"){if($.minimum!==void 0&&D<$.minimum)return`Must be at least ${$.minimum}${v.unit?` ${v.unit}`:""}`;if($.maximum!==void 0&&D>$.maximum)return`Must be at most ${$.maximum}${v.unit?` ${v.unit}`:""}`}return null}function Pt(v){return B.value[v.path]||null}function ma(v){const D=`${v}.`;return Object.keys(B.value).some($=>$===v||$.startsWith(D))}function Ts(){_.value.length&&(S.value.push(Zn(y.value)),y.value=_.value.pop(),m.value={},E.value={},H={path:null,at:0})}function ga(){S.value.length&&(_.value.push(Zn(y.value)),y.value=S.value.pop(),m.value={},E.value={},H={path:null,at:0})}function ni(){!he.value||ie.value||(g.value=!0,w.value=!1)}function va(){g.value=!1}function ba(){$s()}function Gs(v){return Uk[v]||wa(v||"unknown")}function z(v){return`apply-${String(v||"unknown").replaceAll("_","-")}`}function fe(v){return`cfgc-field-${v.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function ke(v){return`${fe(v)}-input`}function Nt(v){const D=document.getElementById(fe(v))||document.getElementById(fe(v.split(".").slice(0,2).join(".")));D==null||D.scrollIntoView({behavior:"smooth",block:"center"})}function Cs(v,D){l.value={type:v,message:D},window.setTimeout(()=>{var $;(($=l.value)==null?void 0:$.message)===D&&(l.value=null)},3500)}function jn(){o.value=!1,p.value="pending_restart",u.value="";const v=$k(n.value);v&&(v.scrollTop=0)}function Ur(){o.value=!1}function ai(v=1800){M&&window.clearTimeout(M),M=window.setTimeout(rl,v)}async function rl(){if(c.value){if(P+=1,P>45){c.value=!1,d.value="Odin did not return with the new startup settings within 90 seconds.";return}try{if(t.value=await lo(),k.value===0){c.value=!1,d.value=null,Cs("success","Odin restarted and the saved startup settings are active.");return}}catch{}ai(2e3)}}async function ya(){if(!c.value){d.value=null;try{await q.post("/api/restart",{}),c.value=!0,P=0,o.value=!1,ai()}catch(v){d.value=v.message||"Odin could not schedule a restart."}}}async function ii(){if(!(!he.value||ie.value||a.value)){a.value=!0;try{const v=qk(e.value,y.value),D=await q.put("/api/config",v);e.value=D,y.value={},_.value=[],S.value=[],m.value={},g.value=!1;try{t.value=await lo(),r.value=null,o.value=k.value>0,Cs("success",k.value?`Configuration saved. ${k.value} setting${k.value===1?"":"s"} still use startup values.`:"Configuration saved. Apply status has been refreshed.")}catch($){r.value=$.message||"Unknown metadata error.",Cs("error",`Configuration saved, but apply status could not be refreshed: ${r.value}`)}}catch(v){Cs("error",v.message||"Configuration could not be saved")}finally{a.value=!1}}}async function ve(){var v,D;if(!he.value){s.value=!0,i.value=null;try{const $=await q.get("/api/config"),ae=await lo();e.value=$,t.value=ae,r.value=null;const Ne=Se.value;if(Ne.some(He=>He.key===f.value)||(f.value=((v=Ne[0])==null?void 0:v.key)||Ha[0].key),T.value){const et=(((D=Ne.find(Vt=>Vt.key===f.value))==null?void 0:D.sections)||[]).find(Vt=>b.value[Vt]===!0);b.value=et?{...b.value,[et]:!0}:{}}}catch($){i.value=$.message||"Unknown configuration error"}finally{s.value=!1}}}function A(v){if(g.value||!(v.ctrlKey||v.metaKey))return;const D=v.target;D instanceof HTMLElement&&(D.matches("input, textarea, select")||D.isContentEditable)||(!v.shiftKey&&v.key.toLowerCase()==="z"?(v.preventDefault(),Ts()):(v.key.toLowerCase()==="y"||v.shiftKey&&v.key.toLowerCase()==="z")&&(v.preventDefault(),ga()))}function K(v){T.value=v.matches}return ns(b,v=>{try{localStorage.setItem(Sm,JSON.stringify(v))}catch{}},{deep:!0}),We(()=>{var v;ve(),document.addEventListener("keydown",A),C=window.matchMedia("(max-width: 760px)"),K(C),(v=C.addEventListener)==null||v.call(C,"change",K)}),xt(()=>{var v;document.removeEventListener("keydown",A),(v=C==null?void 0:C.removeEventListener)==null||v.call(C,"change",K),M&&window.clearTimeout(M)}),{config:e,meta:t,loading:s,saving:a,error:i,toast:l,metaRefreshError:r,restartPromptOpen:o,restartScheduled:c,restartError:d,configMain:n,searchQuery:u,healthFilter:p,activeCategory:f,reviewOpen:g,mobileOverflowOpen:w,warningThresholdInput:O,arrayInputs:x,healthFilters:N,visibleCategories:Se,displayGroups:le,reviewGroups:xe,sectionCount:Q,fieldCount:U,hasChanges:he,changeCount:se,changedSectionCount:me,hasDraftErrors:ie,canUndo:I,canRedo:Y,globalFilterActive:W,reviewRestartCount:ge,pendingRestartCount:k,pendingRestartFields:Fe,healthCount:Ce,categoryStats:Re,selectCategory:ft,selectHealthFilter:ls,clearFilters:Ps,sectionLabel:Z,sectionDescription:X,sectionFieldCount:ee,sectionHealthCount:_e,sectionApplySummary:de,sectionApplyDetails:oe,sectionEntries:ne,fieldGroups:be,sectionSearchHits:ct,fieldRuntimeCopy:Te,fieldSpecificRuntimeNote:Le,hasHonestAction:De,runFieldAction:Be,sectionChanged:Ve,fieldChanged:Pe,isSectionExpanded:Fs,toggleSection:Mt,discardAllDrafts:$s,setFieldValue:zt,setNumberFieldValue:Ye,numberInputValue:os,beginInputEdit:Vn,endTextInputEdit:Ct,endInputEdit:rs,addWarningThreshold:gs,removeWarningThreshold:j,isScalarArray:Ae,addScalarArrayItem:Ze,removeScalarArrayItem:lt,fieldError:Pt,sectionHasErrors:ma,undo:Ts,redo:ga,openReview:ni,closeReview:va,mobileCancel:ba,applyModeLabel:Gs,applyClass:z,compactValue:Vk,formatValue:jk,structuredApplyCopy:ce,fieldId:fe,fieldInputId:ke,focusField:Nt,fetchConfig:ve,saveConfig:ii,restartOdin:ya,restartLater:Ur,reviewPendingRestart:jn}}},Zk=/^\d{15,25}$/;function Am(e){return String((e==null?void 0:e.display_name)||(e==null?void 0:e.username)||(e==null?void 0:e.id)||"Unknown user")}const Rm={props:{members:{type:Array,default:()=>[]},excludedIds:{type:Array,default:()=>[]},placeholder:{type:String,default:"Search Discord users…"},ariaLabel:{type:String,default:"Search Discord users"},optionsId:{type:String,required:!0},autofocus:{type:Boolean,default:!1}},emits:["select"],template:`
t in e?Gm(e,t,{enumerable:!0,config
- `,setup(e,{emit:t}){const s=h(""),n=h(!1),a=h(0),i=h(null),l=J(()=>new Set((e.excludedIds||[]).map(String))),r=J(()=>{const S=s.value.toLowerCase().trim();return(e.members||[]).filter(g=>l.value.has(String(g.id))?!1:S?u(g).toLowerCase().includes(S)||String(g.username||"").toLowerCase().includes(S)||String(g.id).includes(S):!0)}),o=J(()=>{const S=s.value.trim();return r.value.length===0&&Zk.test(S)&&!l.value.has(S)?S:""}),c=J(()=>r.value.length+(o.value?1:0)),d=J(()=>{if(n.value){if(r.value[a.value])return`${e.optionsId}-${a.value}`;if(o.value&&a.value===r.value.length)return`${e.optionsId}-raw`}});function u(S){return Am(S)}function f(){n.value=!0,a.value=0}function p(){f()}function b(){const S=Math.max(c.value-1,0);a.value=Math.min(a.value+1,S)}function y(){a.value=Math.max(a.value-1,0)}function E(){const S=r.value[a.value];S?I(S):o.value&&a.value===r.value.length&&x(o.value)}function I(S){x(String(S.id))}function x(S){t("select",S),s.value="",n.value=!1,a.value=0}function m(){n.value=!1}function _(){setTimeout(m,150)}return We(()=>{e.autofocus&&Rt(()=>{var S;return(S=i.value)==null?void 0:S.focus()})}),{query:s,open:n,highlightedIndex:a,input:i,filteredMembers:r,rawId:o,activeOptionId:d,memberName:u,openOptions:f,onInput:p,highlightNext:b,highlightPrevious:y,selectHighlighted:E,selectMember:I,selectId:x,closeOptions:m,onBlur:_}}};function Pu(e,t,s){var n;return((n=e==null?void 0:e.config)==null?void 0:n[t])!=null?e.config[t]:s==null?void 0:s[t]}const Jk={components:{DiscordUserCombobox:Rm},template:` + `,setup(e,{emit:t}){const s=h(""),n=h(!1),a=h(0),i=h(null),l=J(()=>new Set((e.excludedIds||[]).map(String))),r=J(()=>{const S=s.value.toLowerCase().trim();return(e.members||[]).filter(g=>l.value.has(String(g.id))?!1:S?u(g).toLowerCase().includes(S)||String(g.username||"").toLowerCase().includes(S)||String(g.id).includes(S):!0)}),o=J(()=>{const S=s.value.trim();return r.value.length===0&&Zk.test(S)&&!l.value.has(S)?S:""}),c=J(()=>r.value.length+(o.value?1:0)),d=J(()=>{if(n.value){if(r.value[a.value])return`${e.optionsId}-${a.value}`;if(o.value&&a.value===r.value.length)return`${e.optionsId}-raw`}});function u(S){return Am(S)}function p(){n.value=!0,a.value=0}function f(){p()}function b(){const S=Math.max(c.value-1,0);a.value=Math.min(a.value+1,S)}function y(){a.value=Math.max(a.value-1,0)}function E(){const S=r.value[a.value];S?O(S):o.value&&a.value===r.value.length&&x(o.value)}function O(S){x(String(S.id))}function x(S){t("select",S),s.value="",n.value=!1,a.value=0}function m(){n.value=!1}function _(){setTimeout(m,150)}return We(()=>{e.autofocus&&Rt(()=>{var S;return(S=i.value)==null?void 0:S.focus()})}),{query:s,open:n,highlightedIndex:a,input:i,filteredMembers:r,rawId:o,activeOptionId:d,memberName:u,openOptions:p,onInput:f,highlightNext:b,highlightPrevious:y,selectHighlighted:E,selectMember:O,selectId:x,closeOptions:m,onBlur:_}}};function Pu(e,t,s){var n;return((n=e==null?void 0:e.config)==null?void 0:n[t])!=null?e.config[t]:s==null?void 0:s[t]}const Jk={components:{DiscordUserCombobox:Rm},template:`

Discord Channels

@@ -4360,7 +4383,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h([]),t=h(!0),s=h(null),n=h({}),a=h(null),i=h(null),l=h(!1),r=h(null),o=h({}),c=h([]);let d=0;const u=Object.freeze([{key:"allowed_users",label:"Allowed users",description:"Absolute gate for ordinary conversational intake. Guild/channel settings cannot readmit blocked users; prefix commands use separate authorization and allowed test webhooks bypass this gate.",placeholder:"Search Discord users…",userAutocomplete:!0,fullWidth:!0},{key:"channels",label:"Allowed channels",description:"Absolute gate for ordinary conversational intake. Guild/channel settings cannot readmit blocked channels; prefix commands use separate authorization.",placeholder:"Discord channel ID",fullWidth:!0},{key:"ignore_bot_ids",label:"Ignored bot IDs",description:"Ignored unless the bot explicitly mentions Odin; the effective respond-to-bots policy still applies.",placeholder:"Search Discord users or bots…",userAutocomplete:!0,fullWidth:!0}]),f=J(()=>JSON.stringify(a.value)!==JSON.stringify(i.value)),p=J(()=>new Map(c.value.map(R=>[String(R.id),R])));function b(R){return R.config&&R.config.enabled!==void 0?R.config.enabled:!0}function y(R){return Pu(R,"require_mention",a.value)}function E(R){return Pu(R,"respond_to_bots",a.value)}function I(R){return R.config&&Object.keys(R.config).length>0}function x(R){n.value[R]=!n.value[R]}function m(R){const j=R.discord||{};return{allowed_users:[...j.allowed_users||[]],channels:[...j.channels||[]],respond_to_bots:!!j.respond_to_bots,require_mention:!!j.require_mention,ignore_bot_ids:[...j.ignore_bot_ids||[]]}}async function _({showLoading:R=!0}={}){const j=++d;R&&(t.value=!0),s.value=null;try{const Q=await G.get("/api/discord/guilds");j===d&&(e.value=Q)}catch(Q){j===d&&(s.value=Q.message)}finally{R&&j===d&&(t.value=!1)}}async function S(){t.value=!0,s.value=null;try{const[R,j,Q]=await Promise.all([G.get("/api/discord/guilds"),G.get("/api/discord/members").catch(()=>[]),G.get("/api/config")]),U=m(Q),O=f.value;a.value=U,O||(i.value=JSON.parse(JSON.stringify(U))),c.value=j,e.value=R,r.value=null}catch(R){s.value=R.message}finally{t.value=!1}}async function g(R,j,Q){try{await G.put("/api/discord/guild/"+R+"/config",{[j]:Q}),await _({showLoading:!1})}catch(U){s.value=U.message}}async function w(R,j,Q,U){try{await G.put("/api/discord/channel/"+R+"/config",{[Q]:U}),await _({showLoading:!1})}catch(O){s.value=O.message}}async function T(R,j){try{await G.put("/api/discord/channel/"+R+"/config",{clear:!0}),await _({showLoading:!1})}catch(Q){s.value=Q.message}}function C(R,j){const Q=String(j);if(!R.userAutocomplete)return Q;const U=p.value.get(Q);return U?Am(U):Q}function M(R,j=null){const Q=String(j??o.value[R]??"").trim();!Q||i.value[R].includes(Q)||(i.value[R]=[...i.value[R],Q],o.value={...o.value,[R]:""})}function H(R,j){i.value[R]=i.value[R].filter(Q=>Q!==j)}async function P(){if(!(!f.value||l.value)){l.value=!0,r.value=null;try{const j=(await G.put("/api/config",{discord:i.value})).discord||i.value;a.value={allowed_users:[...j.allowed_users||[]],channels:[...j.channels||[]],respond_to_bots:!!j.respond_to_bots,require_mention:!!j.require_mention,ignore_bot_ids:[...j.ignore_bot_ids||[]]},i.value=JSON.parse(JSON.stringify(a.value))}catch(R){r.value=R.message||"Global defaults could not be saved."}finally{l.value=!1}}}return We(S),{guilds:e,loading:t,error:s,expanded:n,globalDraft:i,globalSaving:l,globalError:r,globalArrayInputs:o,globalMembers:c,globalListEditors:u,globalChanged:f,guildEnabled:b,guildMention:y,guildBots:E,hasOverride:I,toggleGuild:x,fetchAll:S,fetchGuilds:_,setGuildConfig:g,setChannelConfig:w,clearOverride:T,globalItemLabel:C,addGlobalItem:M,removeGlobalItem:H,saveGlobalDefaults:P}}},vs=e=>e==null?e:JSON.parse(JSON.stringify(e));function Yk({applyDefault:e,applyUser:t,applyDelete:s,onDefaultConfirmed:n=()=>{},onDefaultRollback:a=()=>{},onUserConfirmed:i=()=>{},onUserRollback:l=()=>{},onUserDeleted:r=()=>{},onError:o=()=>{}}){let c=Promise.resolve(),d=0,u=0;const f=new Map;let p=null;const b=new Map;function y(g){d+=1;const w=c.then(g,g);return c=w.catch(()=>{}),w}function E(g,w){p=vs(g),b.clear();for(const[T,C]of Object.entries(w||{}))b.set(T,vs(C))}function I(g){const w=vs(g),T=++u;return y(async()=>{try{await e(vs(w)),p=vs(w),T===u&&n(vs(w))}catch(C){T===u&&(a(vs(p)),o(C,{kind:"default"}))}})}function x(g,w){const T=vs(w),C=(f.get(g)||0)+1;return f.set(g,C),y(async()=>{try{await t(g,vs(T)),b.set(g,vs(T)),C===f.get(g)&&i(g,vs(T))}catch(M){C===f.get(g)&&(l(g,vs(b.get(g)??null)),o(M,{kind:"user",uid:g}))}})}function m(g){const w=(f.get(g)||0)+1;return f.set(g,w),y(async()=>{try{await s(g),b.delete(g),w===f.get(g)&&r(g)}catch(T){w===f.get(g)&&(l(g,vs(b.get(g)??null)),o(T,{kind:"delete",uid:g}))}})}async function _(){for(;;){const g=c;if(await g,g===c)return d}}async function S(g){for(;;){const w=await _(),T=await g();if(w===d)return T}}return{seed:E,saveDefault:I,saveUser:x,deleteUser:m,whenIdle:_,readSnapshot:S,get revision(){return d}}}const Qk={components:{DiscordUserCombobox:Rm},template:` + `,setup(){const e=h([]),t=h(!0),s=h(null),n=h({}),a=h(null),i=h(null),l=h(!1),r=h(null),o=h({}),c=h([]);let d=0;const u=Object.freeze([{key:"allowed_users",label:"Allowed users",description:"Absolute gate for ordinary conversational intake. Guild/channel settings cannot readmit blocked users; prefix commands use separate authorization and allowed test webhooks bypass this gate.",placeholder:"Search Discord users…",userAutocomplete:!0,fullWidth:!0},{key:"channels",label:"Allowed channels",description:"Absolute gate for ordinary conversational intake. Guild/channel settings cannot readmit blocked channels; prefix commands use separate authorization.",placeholder:"Discord channel ID",fullWidth:!0},{key:"ignore_bot_ids",label:"Ignored bot IDs",description:"Ignored unless the bot explicitly mentions Odin; the effective respond-to-bots policy still applies.",placeholder:"Search Discord users or bots…",userAutocomplete:!0,fullWidth:!0}]),p=J(()=>JSON.stringify(a.value)!==JSON.stringify(i.value)),f=J(()=>new Map(c.value.map(R=>[String(R.id),R])));function b(R){return R.config&&R.config.enabled!==void 0?R.config.enabled:!0}function y(R){return Pu(R,"require_mention",a.value)}function E(R){return Pu(R,"respond_to_bots",a.value)}function O(R){return R.config&&Object.keys(R.config).length>0}function x(R){n.value[R]=!n.value[R]}function m(R){const V=R.discord||{};return{allowed_users:[...V.allowed_users||[]],channels:[...V.channels||[]],respond_to_bots:!!V.respond_to_bots,require_mention:!!V.require_mention,ignore_bot_ids:[...V.ignore_bot_ids||[]]}}async function _({showLoading:R=!0}={}){const V=++d;R&&(t.value=!0),s.value=null;try{const Q=await q.get("/api/discord/guilds");V===d&&(e.value=Q)}catch(Q){V===d&&(s.value=Q.message)}finally{R&&V===d&&(t.value=!1)}}async function S(){t.value=!0,s.value=null;try{const[R,V,Q]=await Promise.all([q.get("/api/discord/guilds"),q.get("/api/discord/members").catch(()=>[]),q.get("/api/config")]),U=m(Q),N=p.value;a.value=U,N||(i.value=JSON.parse(JSON.stringify(U))),c.value=V,e.value=R,r.value=null}catch(R){s.value=R.message}finally{t.value=!1}}async function g(R,V,Q){try{await q.put("/api/discord/guild/"+R+"/config",{[V]:Q}),await _({showLoading:!1})}catch(U){s.value=U.message}}async function w(R,V,Q,U){try{await q.put("/api/discord/channel/"+R+"/config",{[Q]:U}),await _({showLoading:!1})}catch(N){s.value=N.message}}async function T(R,V){try{await q.put("/api/discord/channel/"+R+"/config",{clear:!0}),await _({showLoading:!1})}catch(Q){s.value=Q.message}}function C(R,V){const Q=String(V);if(!R.userAutocomplete)return Q;const U=f.value.get(Q);return U?Am(U):Q}function M(R,V=null){const Q=String(V??o.value[R]??"").trim();!Q||i.value[R].includes(Q)||(i.value[R]=[...i.value[R],Q],o.value={...o.value,[R]:""})}function H(R,V){i.value[R]=i.value[R].filter(Q=>Q!==V)}async function P(){if(!(!p.value||l.value)){l.value=!0,r.value=null;try{const V=(await q.put("/api/config",{discord:i.value})).discord||i.value;a.value={allowed_users:[...V.allowed_users||[]],channels:[...V.channels||[]],respond_to_bots:!!V.respond_to_bots,require_mention:!!V.require_mention,ignore_bot_ids:[...V.ignore_bot_ids||[]]},i.value=JSON.parse(JSON.stringify(a.value))}catch(R){r.value=R.message||"Global defaults could not be saved."}finally{l.value=!1}}}return We(S),{guilds:e,loading:t,error:s,expanded:n,globalDraft:i,globalSaving:l,globalError:r,globalArrayInputs:o,globalMembers:c,globalListEditors:u,globalChanged:p,guildEnabled:b,guildMention:y,guildBots:E,hasOverride:O,toggleGuild:x,fetchAll:S,fetchGuilds:_,setGuildConfig:g,setChannelConfig:w,clearOverride:T,globalItemLabel:C,addGlobalItem:M,removeGlobalItem:H,saveGlobalDefaults:P}}},vs=e=>e==null?e:JSON.parse(JSON.stringify(e));function Yk({applyDefault:e,applyUser:t,applyDelete:s,onDefaultConfirmed:n=()=>{},onDefaultRollback:a=()=>{},onUserConfirmed:i=()=>{},onUserRollback:l=()=>{},onUserDeleted:r=()=>{},onError:o=()=>{}}){let c=Promise.resolve(),d=0,u=0;const p=new Map;let f=null;const b=new Map;function y(g){d+=1;const w=c.then(g,g);return c=w.catch(()=>{}),w}function E(g,w){f=vs(g),b.clear();for(const[T,C]of Object.entries(w||{}))b.set(T,vs(C))}function O(g){const w=vs(g),T=++u;return y(async()=>{try{await e(vs(w)),f=vs(w),T===u&&n(vs(w))}catch(C){T===u&&(a(vs(f)),o(C,{kind:"default"}))}})}function x(g,w){const T=vs(w),C=(p.get(g)||0)+1;return p.set(g,C),y(async()=>{try{await t(g,vs(T)),b.set(g,vs(T)),C===p.get(g)&&i(g,vs(T))}catch(M){C===p.get(g)&&(l(g,vs(b.get(g)??null)),o(M,{kind:"user",uid:g}))}})}function m(g){const w=(p.get(g)||0)+1;return p.set(g,w),y(async()=>{try{await s(g),b.delete(g),w===p.get(g)&&r(g)}catch(T){w===p.get(g)&&(l(g,vs(b.get(g)??null)),o(T,{kind:"delete",uid:g}))}})}async function _(){for(;;){const g=c;if(await g,g===c)return d}}async function S(g){for(;;){const w=await _(),T=await g();if(w===d)return T}}return{seed:E,saveDefault:O,saveUser:x,deleteUser:m,whenIdle:_,readSnapshot:S,get revision(){return d}}}const Qk={components:{DiscordUserCombobox:Rm},template:`

Host Access Control

@@ -4480,7 +4503,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(!0),t=h(""),s=h(null),n=h([]),a=h({allowed_hosts:[],default_host:""}),i=h({}),l=h(!1),r=h([]),o=J(()=>{const g={};for(const w of r.value)g[w.id]=w;return g});function c(g){return o.value[g]||null}function d(g,w){return g?g.allowed_hosts===null||g.allowed_hosts===void 0?{allowed_hosts:[...w],default_host:g.default_host||"",allow_all:!0}:{allowed_hosts:g.allowed_hosts,default_host:g.default_host||"",allow_all:!1}:{allowed_hosts:[...w],default_host:w[0]||"",allow_all:!0}}const u=Yk({applyDefault:async g=>{const w=g.allow_all?null:g.allowed_hosts;await G.put("/api/host-access/default-policy",{allowed_hosts:w,default_host:g.default_host})},applyUser:async(g,w)=>{const T=w.allow_all?null:w.allowed_hosts;await G.put(`/api/host-access/user/${g}`,{allowed_hosts:T,default_host:w.default_host})},applyDelete:g=>G.del(`/api/host-access/user/${g}`),onDefaultConfirmed:()=>Ae.success("Default policy updated"),onDefaultRollback:g=>{g&&(a.value=g)},onUserConfirmed:g=>{const w=c(g);Ae.success(`Updated access for ${w?w.display_name:g}`)},onUserRollback:(g,w)=>{const T={...i.value};w?T[g]=w:delete T[g],i.value=T},onUserDeleted:g=>{const w={...i.value};delete w[g],i.value=w},onError:(g,w)=>{var C;const T=w.uid?` ${((C=c(w.uid))==null?void 0:C.display_name)||w.uid}`:"";Ae.error(`${g.message||"Failed to save"} — reverted${T}`)}});let f=0;async function p(){const g=++f;e.value=!0,t.value="";try{const w=await u.readSnapshot(()=>G.get("/api/host-access"));if(g!==f)return;s.value=w,n.value=w.available_hosts||[],a.value=d(w.default_policy,n.value);const T=w.users||{},C={};for(const[M,H]of Object.entries(T))C[M]=d(H,n.value);i.value=C,u.seed(a.value,C)}catch(w){g===f&&(t.value=w.message||"Failed to fetch host access data")}finally{g===f&&(e.value=!1)}try{const w=await G.get("/api/discord/members")||[];g===f&&(r.value=w)}catch{g===f&&(r.value=[])}}function b(){u.saveDefault(a.value)}function y(g,w){a.value.allow_all=!1,w?a.value.allowed_hosts.includes(g)||a.value.allowed_hosts.push(g):(a.value.allowed_hosts=a.value.allowed_hosts.filter(T=>T!==g),a.value.default_host===g&&(a.value.default_host=a.value.allowed_hosts[0]||"")),b()}function E(g){const w=i.value[g];w&&u.saveUser(g,w)}function I(g,w,T){const C=i.value[g];C&&(C.allow_all=!1,T?C.allowed_hosts.includes(w)||C.allowed_hosts.push(w):(C.allowed_hosts=C.allowed_hosts.filter(M=>M!==w),C.default_host===w&&(C.default_host=C.allowed_hosts[0]||"")),E(g))}function x(g,w){const T=i.value[g];T&&(T.default_host=w,E(g))}function m(){l.value=!0}function _(g){!/^\d{15,25}$/.test(g)||i.value[g]||(i.value[g]={allowed_hosts:[...n.value],default_host:n.value[0]||"",allow_all:!1},E(g),l.value=!1)}async function S(g){const w=c(g);await _s({title:"Remove user override",message:`Remove the host access override for ${w?w.display_name:g}? They will fall back to the default policy.`,confirmLabel:"Remove",danger:!0})&&(await u.deleteUser(g),i.value[g]||Ae.success(`Removed override for ${w?w.display_name:g}`))}return We(p),{loading:e,error:t,data:s,availableHosts:n,defaultPolicy:a,users:i,showAddUser:l,members:r,fetchData:p,saveDefaultPolicy:b,toggleDefaultHost:y,getMember:c,toggleUserHost:I,setUserDefault:x,openAddUser:m,addUserById:_,deleteUser:S}}},Xk={template:` + `,setup(){const e=h(!0),t=h(""),s=h(null),n=h([]),a=h({allowed_hosts:[],default_host:""}),i=h({}),l=h(!1),r=h([]),o=J(()=>{const g={};for(const w of r.value)g[w.id]=w;return g});function c(g){return o.value[g]||null}function d(g,w){return g?g.allowed_hosts===null||g.allowed_hosts===void 0?{allowed_hosts:[...w],default_host:g.default_host||"",allow_all:!0}:{allowed_hosts:g.allowed_hosts,default_host:g.default_host||"",allow_all:!1}:{allowed_hosts:[...w],default_host:w[0]||"",allow_all:!0}}const u=Yk({applyDefault:async g=>{const w=g.allow_all?null:g.allowed_hosts;await q.put("/api/host-access/default-policy",{allowed_hosts:w,default_host:g.default_host})},applyUser:async(g,w)=>{const T=w.allow_all?null:w.allowed_hosts;await q.put(`/api/host-access/user/${g}`,{allowed_hosts:T,default_host:w.default_host})},applyDelete:g=>q.del(`/api/host-access/user/${g}`),onDefaultConfirmed:()=>Ee.success("Default policy updated"),onDefaultRollback:g=>{g&&(a.value=g)},onUserConfirmed:g=>{const w=c(g);Ee.success(`Updated access for ${w?w.display_name:g}`)},onUserRollback:(g,w)=>{const T={...i.value};w?T[g]=w:delete T[g],i.value=T},onUserDeleted:g=>{const w={...i.value};delete w[g],i.value=w},onError:(g,w)=>{var C;const T=w.uid?` ${((C=c(w.uid))==null?void 0:C.display_name)||w.uid}`:"";Ee.error(`${g.message||"Failed to save"} — reverted${T}`)}});let p=0;async function f(){const g=++p;e.value=!0,t.value="";try{const w=await u.readSnapshot(()=>q.get("/api/host-access"));if(g!==p)return;s.value=w,n.value=w.available_hosts||[],a.value=d(w.default_policy,n.value);const T=w.users||{},C={};for(const[M,H]of Object.entries(T))C[M]=d(H,n.value);i.value=C,u.seed(a.value,C)}catch(w){g===p&&(t.value=w.message||"Failed to fetch host access data")}finally{g===p&&(e.value=!1)}try{const w=await q.get("/api/discord/members")||[];g===p&&(r.value=w)}catch{g===p&&(r.value=[])}}function b(){u.saveDefault(a.value)}function y(g,w){a.value.allow_all=!1,w?a.value.allowed_hosts.includes(g)||a.value.allowed_hosts.push(g):(a.value.allowed_hosts=a.value.allowed_hosts.filter(T=>T!==g),a.value.default_host===g&&(a.value.default_host=a.value.allowed_hosts[0]||"")),b()}function E(g){const w=i.value[g];w&&u.saveUser(g,w)}function O(g,w,T){const C=i.value[g];C&&(C.allow_all=!1,T?C.allowed_hosts.includes(w)||C.allowed_hosts.push(w):(C.allowed_hosts=C.allowed_hosts.filter(M=>M!==w),C.default_host===w&&(C.default_host=C.allowed_hosts[0]||"")),E(g))}function x(g,w){const T=i.value[g];T&&(T.default_host=w,E(g))}function m(){l.value=!0}function _(g){!/^\d{15,25}$/.test(g)||i.value[g]||(i.value[g]={allowed_hosts:[...n.value],default_host:n.value[0]||"",allow_all:!1},E(g),l.value=!1)}async function S(g){const w=c(g);await _s({title:"Remove user override",message:`Remove the host access override for ${w?w.display_name:g}? They will fall back to the default policy.`,confirmLabel:"Remove",danger:!0})&&(await u.deleteUser(g),i.value[g]||Ee.success(`Removed override for ${w?w.display_name:g}`))}return We(f),{loading:e,error:t,data:s,availableHosts:n,defaultPolicy:a,users:i,showAddUser:l,members:r,fetchData:f,saveDefaultPolicy:b,toggleDefaultHost:y,getMember:c,toggleUserHost:O,setUserDefault:x,openAddUser:m,addUserById:_,deleteUser:S}}},Xk={template:`

API Tokens

@@ -4723,7 +4746,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(!0),t=h(""),s=h(null),n=h([]),a=h(!1),i=h(!1),l=h(null),r=h(null),o=h(!1),c=h({user_id:"",username:"",tier:"admin",label:"",host_mode:"default",allowed_hosts:[],default_host:"",allowed_tools_str:""}),d=h({username:"",tier:"admin",label:"",host_mode:"default",allowed_hosts:[],default_host:"",allowed_tools_str:""}),u=J(()=>c.value.host_mode==="select"?c.value.allowed_hosts:c.value.host_mode==="none"?[]:n.value),f=J(()=>d.value.host_mode==="select"?d.value.allowed_hosts:d.value.host_mode==="none"?[]:n.value);function p(T){return T==="admin"?"text-xs px-1.5 py-0.5 rounded bg-red-900/50 text-red-400":T==="user"?"text-xs px-1.5 py-0.5 rounded bg-blue-900/50 text-blue-400":"text-xs px-1.5 py-0.5 rounded bg-gray-700 text-gray-400"}async function b(){e.value=!0,t.value="";try{const T=await G.get("/api/tokens");s.value=T.tokens||[],n.value=T.available_hosts||[]}catch(T){t.value=T.message||"Failed to load tokens"}finally{e.value=!1}}function y(T){return!T||!T.trim()?[]:T.split(",").map(C=>C.trim()).filter(Boolean)}function E(T,C){const M=c.value.allowed_hosts;if(C&&!M.includes(T)&&M.push(T),!C){const H=M.indexOf(T);H>=0&&M.splice(H,1)}}function I(T,C){const M=d.value.allowed_hosts;if(C&&!M.includes(T)&&M.push(T),!C){const H=M.indexOf(T);H>=0&&M.splice(H,1)}}async function x(){var T;i.value=!0;try{const C=y(c.value.allowed_tools_str),M=c.value.host_mode,H=M==="none"?[]:M==="select"?c.value.allowed_hosts:null,P={user_id:c.value.user_id.trim(),username:c.value.username.trim()||"API",tier:c.value.tier,label:c.value.label.trim(),allowed_tools:C.length?C:[]};H!==null&&(P.allowed_hosts=H),P.default_host=c.value.default_host||"";const R=await G.post("/api/tokens",P);l.value=R.token,c.value={user_id:"",username:"",tier:"admin",label:"",host_mode:"default",allowed_hosts:[],default_host:"",allowed_tools_str:""},a.value=!1,Ae.success("Token created"),await b()}catch(C){Ae.error(((T=C.data)==null?void 0:T.error)||C.message||"Failed to create token")}finally{i.value=!1}}function m(T){r.value=T;const C=T.allowed_hosts;let M="default";C==null?M="default":Array.isArray(C)&&C.length===0?M="none":Array.isArray(C)&&(M="select"),d.value={username:T.username||"",tier:T.tier||"admin",label:T.label||"",host_mode:M,allowed_hosts:Array.isArray(C)?[...C]:[],default_host:T.default_host||"",allowed_tools_str:(T.allowed_tools||[]).join(", ")}}async function _(){var T;if(r.value){o.value=!0;try{const C=y(d.value.allowed_tools_str),M=d.value.host_mode,H={username:d.value.username,tier:d.value.tier,label:d.value.label,allowed_tools:C};M==="none"?H.allowed_hosts=[]:M==="select"?H.allowed_hosts=d.value.allowed_hosts:H.allowed_hosts=null,H.default_host=d.value.default_host||"",await G.put("/api/tokens/"+encodeURIComponent(r.value.user_id),H),r.value=null,Ae.success("Token updated"),await b()}catch(C){Ae.error(((T=C.data)==null?void 0:T.error)||C.message||"Failed to update")}finally{o.value=!1}}}async function S(T){var M;if(await _s({title:"Regenerate token",message:`Regenerate token for ${T.username||T.user_id}? The old token will stop working immediately.`,confirmLabel:"Regenerate",danger:!0}))try{const H=await G.post("/api/tokens/"+encodeURIComponent(T.user_id)+"/regenerate");l.value=H.token,Ae.success("Token regenerated")}catch(H){Ae.error(((M=H.data)==null?void 0:M.error)||H.message||"Failed to regenerate")}}async function g(T){var M;if(await _s({title:"Delete token",message:`Delete token for ${T.username||T.user_id}? This cannot be undone.`,confirmLabel:"Delete",danger:!0}))try{await G.del("/api/tokens/"+encodeURIComponent(T.user_id)),Ae.success("Token deleted"),await b()}catch(H){Ae.error(((M=H.data)==null?void 0:M.error)||H.message||"Failed to delete")}}async function w(){if(l.value)try{await navigator.clipboard.writeText(l.value),Ae.success("Copied to clipboard")}catch{Ae.error("Copy failed — select and copy manually")}}return We(b),{loading:e,error:t,tokens:s,availableHosts:n,showCreate:a,creating:i,newToken:l,editing:r,saving:o,createForm:c,editForm:d,createDefaultHostOptions:u,editDefaultHostOptions:f,fetchData:b,tierBadge:p,toggleCreateHost:E,toggleEditHost:I,createToken:x,startEdit:m,saveEdit:_,confirmRegenerate:S,confirmDelete:g,copyToken:w}}},ew=Object.freeze(["enabled","model","reasoning_effort","agent_reasoning_effort","agent_model"]),tw=Object.freeze(["request_timeout_seconds","stream_stall_timeout_seconds","retry","connection_pool","context_compression","context_budget_overrides","context_utilization"]),sw=Object.freeze(["enabled","base_url","model","max_tokens"]),nw=Object.freeze(["enabled","model","max_tokens"]);function Pr(e,t){return Object.fromEntries(t.map(s=>[s,e[s]]))}function Fu(e){return Pr(e,ew)}function $u(e){return Pr(e,tw)}function aw(e,{includeApiKey:t=!1}={}){const s=Pr(e,sw);return t&&(s.api_key=e.api_key),s}function iw(e){return{timeout:e.timeout}}function lw(e,{includeApiKey:t=!1}={}){const s=Pr(e,nw);return t&&(s.api_key=e.api_key),s}function rw(e){return{timeout:e.timeout}}function kl(e,t=500){let s=null;const n=(...a)=>{s&&clearTimeout(s),s=setTimeout(()=>{s=null,e(...a)},t)};return n.pending=()=>s!==null,n.cancel=()=>{s&&(clearTimeout(s),s=null)},n}const ow={template:` + `,setup(){const e=h(!0),t=h(""),s=h(null),n=h([]),a=h(!1),i=h(!1),l=h(null),r=h(null),o=h(!1),c=h({user_id:"",username:"",tier:"admin",label:"",host_mode:"default",allowed_hosts:[],default_host:"",allowed_tools_str:""}),d=h({username:"",tier:"admin",label:"",host_mode:"default",allowed_hosts:[],default_host:"",allowed_tools_str:""}),u=J(()=>c.value.host_mode==="select"?c.value.allowed_hosts:c.value.host_mode==="none"?[]:n.value),p=J(()=>d.value.host_mode==="select"?d.value.allowed_hosts:d.value.host_mode==="none"?[]:n.value);function f(T){return T==="admin"?"text-xs px-1.5 py-0.5 rounded bg-red-900/50 text-red-400":T==="user"?"text-xs px-1.5 py-0.5 rounded bg-blue-900/50 text-blue-400":"text-xs px-1.5 py-0.5 rounded bg-gray-700 text-gray-400"}async function b(){e.value=!0,t.value="";try{const T=await q.get("/api/tokens");s.value=T.tokens||[],n.value=T.available_hosts||[]}catch(T){t.value=T.message||"Failed to load tokens"}finally{e.value=!1}}function y(T){return!T||!T.trim()?[]:T.split(",").map(C=>C.trim()).filter(Boolean)}function E(T,C){const M=c.value.allowed_hosts;if(C&&!M.includes(T)&&M.push(T),!C){const H=M.indexOf(T);H>=0&&M.splice(H,1)}}function O(T,C){const M=d.value.allowed_hosts;if(C&&!M.includes(T)&&M.push(T),!C){const H=M.indexOf(T);H>=0&&M.splice(H,1)}}async function x(){var T;i.value=!0;try{const C=y(c.value.allowed_tools_str),M=c.value.host_mode,H=M==="none"?[]:M==="select"?c.value.allowed_hosts:null,P={user_id:c.value.user_id.trim(),username:c.value.username.trim()||"API",tier:c.value.tier,label:c.value.label.trim(),allowed_tools:C.length?C:[]};H!==null&&(P.allowed_hosts=H),P.default_host=c.value.default_host||"";const R=await q.post("/api/tokens",P);l.value=R.token,c.value={user_id:"",username:"",tier:"admin",label:"",host_mode:"default",allowed_hosts:[],default_host:"",allowed_tools_str:""},a.value=!1,Ee.success("Token created"),await b()}catch(C){Ee.error(((T=C.data)==null?void 0:T.error)||C.message||"Failed to create token")}finally{i.value=!1}}function m(T){r.value=T;const C=T.allowed_hosts;let M="default";C==null?M="default":Array.isArray(C)&&C.length===0?M="none":Array.isArray(C)&&(M="select"),d.value={username:T.username||"",tier:T.tier||"admin",label:T.label||"",host_mode:M,allowed_hosts:Array.isArray(C)?[...C]:[],default_host:T.default_host||"",allowed_tools_str:(T.allowed_tools||[]).join(", ")}}async function _(){var T;if(r.value){o.value=!0;try{const C=y(d.value.allowed_tools_str),M=d.value.host_mode,H={username:d.value.username,tier:d.value.tier,label:d.value.label,allowed_tools:C};M==="none"?H.allowed_hosts=[]:M==="select"?H.allowed_hosts=d.value.allowed_hosts:H.allowed_hosts=null,H.default_host=d.value.default_host||"",await q.put("/api/tokens/"+encodeURIComponent(r.value.user_id),H),r.value=null,Ee.success("Token updated"),await b()}catch(C){Ee.error(((T=C.data)==null?void 0:T.error)||C.message||"Failed to update")}finally{o.value=!1}}}async function S(T){var M;if(await _s({title:"Regenerate token",message:`Regenerate token for ${T.username||T.user_id}? The old token will stop working immediately.`,confirmLabel:"Regenerate",danger:!0}))try{const H=await q.post("/api/tokens/"+encodeURIComponent(T.user_id)+"/regenerate");l.value=H.token,Ee.success("Token regenerated")}catch(H){Ee.error(((M=H.data)==null?void 0:M.error)||H.message||"Failed to regenerate")}}async function g(T){var M;if(await _s({title:"Delete token",message:`Delete token for ${T.username||T.user_id}? This cannot be undone.`,confirmLabel:"Delete",danger:!0}))try{await q.del("/api/tokens/"+encodeURIComponent(T.user_id)),Ee.success("Token deleted"),await b()}catch(H){Ee.error(((M=H.data)==null?void 0:M.error)||H.message||"Failed to delete")}}async function w(){if(l.value)try{await navigator.clipboard.writeText(l.value),Ee.success("Copied to clipboard")}catch{Ee.error("Copy failed — select and copy manually")}}return We(b),{loading:e,error:t,tokens:s,availableHosts:n,showCreate:a,creating:i,newToken:l,editing:r,saving:o,createForm:c,editForm:d,createDefaultHostOptions:u,editDefaultHostOptions:p,fetchData:b,tierBadge:f,toggleCreateHost:E,toggleEditHost:O,createToken:x,startEdit:m,saveEdit:_,confirmRegenerate:S,confirmDelete:g,copyToken:w}}},ew=Object.freeze(["enabled","model","reasoning_effort","agent_reasoning_effort","agent_model"]),tw=Object.freeze(["request_timeout_seconds","stream_stall_timeout_seconds","retry","connection_pool","context_compression","context_budget_overrides","context_utilization"]),sw=Object.freeze(["enabled","base_url","model","max_tokens"]),nw=Object.freeze(["enabled","model","max_tokens"]);function Pr(e,t){return Object.fromEntries(t.map(s=>[s,e[s]]))}function Fu(e){return Pr(e,ew)}function $u(e){return Pr(e,tw)}function aw(e,{includeApiKey:t=!1}={}){const s=Pr(e,sw);return t&&(s.api_key=e.api_key),s}function iw(e){return{timeout:e.timeout}}function lw(e,{includeApiKey:t=!1}={}){const s=Pr(e,nw);return t&&(s.api_key=e.api_key),s}function rw(e){return{timeout:e.timeout}}function kl(e,t=500){let s=null;const n=(...a)=>{s&&clearTimeout(s),s=setTimeout(()=>{s=null,e(...a)},t)};return n.pending=()=>s!==null,n.cancel=()=>{s&&(clearTimeout(s),s=null)},n}const ow={template:`
@@ -5280,7 +5303,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(!0),t=h(null),s=h("codex"),n=h({enabled:!1,model:"gpt-5.6-sol",reasoning_effort:"xhigh",agent_reasoning_effort:"auto",agent_model:"auto",request_timeout_seconds:3600,stream_stall_timeout_seconds:180,retry:{max_retries:3,base_delay:1,max_delay:30},connection_pool:{max_connections:10,keepalive_timeout:30},context_compression:{enabled:!0,max_context_chars:null,keep_recent_iterations:30},context_budget_overrides:{},context_utilization:60}),a=["gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-5.5"],i=J(()=>{const z=n.value.model;return z&&!a.includes(z)?[z,...a]:a}),l=J(()=>{const z=n.value.agent_model;return z&&z!=="auto"&&!a.includes(z)?[z,...a]:a}),r=["gpt-5.5","gpt-5.4","gpt-5.4-mini"],o=J(()=>!r.includes(n.value.model)&&!(r.includes(n.value.agent_model)&&n.value.agent_reasoning_effort==="")),c=J(()=>{const z=n.value.agent_model;return z==="auto"?!0:!r.includes(z||n.value.model)}),d=J(()=>{const z=n.value.agent_reasoning_effort;return z==="auto"?!1:(z||n.value.reasoning_effort)==="max"}),u=z=>r.includes(z)&&(n.value.reasoning_effort==="max"||n.value.agent_model===""&&d.value),f=z=>r.includes(z)&&d.value,p=h({enabled:!1,model:"gpt-5.6-luna"}),b=h({unavailable_reason:null}),y=J(()=>{const z=p.value.model;return z&&!a.includes(z)?[z,...a]:a});function E(z){const pe=z.target.value;p.value.enabled=pe!=="",pe!==""&&(p.value.model=pe),rs()}const I=h(!1),x=h({codex:!1,ollama:!1,kimi:!1}),m=h(null),_=h(!1),S=h(""),g=h(null),w=h(!1);let T=0;const C=J(()=>{var z;return Object.entries(((z=m.value)==null?void 0:z.models)||{}).map(([pe,_e])=>{var Nt,Cs,jn;return{model:pe,floor:_e.floor,override:_e.override,effectiveBudget:(Nt=_e.effective)==null?void 0:Nt.effective_budget,configuredPrimaryChars:(Cs=_e.configured)==null?void 0:Cs.primary_chars,primaryChars:(jn=_e.effective)==null?void 0:jn.primary_chars,provenance:_e.provenance,clampExpiresAt:_e.clamp_expires_at}})}),M=J(()=>{var z;return((z=m.value)==null?void 0:z.clamps)||[]}),H=J(()=>{var z,pe;return((pe=(z=m.value)==null?void 0:z.models)==null?void 0:pe[n.value.model])||null}),P=h({enabled:!1,base_url:"",model:"",api_key:"",max_tokens:4096,timeout:300}),R=h({enabled:!1,api_key:"",model:"",max_tokens:4096,timeout:300}),j=h(!1),Q=h(!1),U=h(!1),O=h(!1),N=h(!1),Y=h(!1),we=h(!1),ke=h({configured:!1}),ie=h([]),he=h(""),F=h(!1),se=h(!1),Se=h({configured:!1}),V=h([]),de=h(""),ce=h(!1),ye=h(!1),ge=h(!0),He=h(""),k=h({configured:!1,accounts:[]}),L=h(null),$=h(null),ee=h(""),Z=h(null),X=h(!1),ue=h(null),oe=h(null),le=h("");let te=null;function ne(z,pe="success"){Ae(z,pe==="error"?"error":"success")}function fe(z){if(!z)return"?";const pe=z/(1024*1024*1024);return pe>=1?pe.toFixed(1)+" GB":(z/(1024*1024)).toFixed(0)+" MB"}function ve(z){return Number.isFinite(Number(z))?Number(z).toLocaleString():"—"}function Te(z){return z==null?"automatic (model-derived)":Number(z).toLocaleString()+" characters"}function Oe(z){const pe=new Date(z);return Number.isNaN(pe.getTime())?"unknown":pe.toLocaleString([],{dateStyle:"medium",timeStyle:"short"})}function Le(z){return typeof z=="string"&&z.length>12?z.slice(0,8)+"…"+z.slice(-4):z}function De(z){return z==="temporary learned clamp"?"is-clamp":z==="override"?"is-override":"is-built-in"}function Be(z){const pe=n.value.context_budget_overrides[z.model];return z.floor!=null&&Number.isFinite(Number(pe))&&Number(pe)>z.floor}function qe(z,pe){const _e={...n.value.context_budget_overrides};pe.target.value===""?delete _e[z]:_e[z]=Number(pe.target.value),n.value.context_budget_overrides=_e,w.value=!0}function ct(z){n.value.context_utilization=z.target.value===""?"":Number(z.target.value),w.value=!0}function K(z){const pe={...n.value.context_budget_overrides};delete pe[z],n.value.context_budget_overrides=pe,w.value=!0}async function xe(){e.value=!0,await Promise.all([Ce(),Ve(),Ss(),Pe(),Re()]),e.value=!1}async function Ce({preserveBasic:z=!1,preserveAdvanced:pe=!1}={}){try{const _e=await G.get("/api/llm/status");t.value=_e,s.value=_e.active_provider||"codex",_e.codex&&!Ct.pending()&&(z||(n.value.enabled=_e.codex.enabled,n.value.model=_e.codex.model||"gpt-5.6-sol",n.value.reasoning_effort=_e.codex.reasoning_effort||"medium",n.value.agent_reasoning_effort=_e.codex.agent_reasoning_effort||"",n.value.agent_model=_e.codex.agent_model||""),pe||(n.value.request_timeout_seconds=_e.codex.request_timeout_seconds??n.value.request_timeout_seconds,n.value.stream_stall_timeout_seconds=_e.codex.stream_stall_timeout_seconds??n.value.stream_stall_timeout_seconds,n.value.retry={...n.value.retry,..._e.codex.retry||{}},n.value.connection_pool={...n.value.connection_pool,..._e.codex.connection_pool||{}},n.value.context_compression={...n.value.context_compression,..._e.codex.context_compression||{}},!w.value&&!U.value&&(n.value.context_budget_overrides={..._e.codex.context_budget_overrides||{}},n.value.context_utilization=_e.codex.context_utilization??n.value.context_utilization))),_e.ollama&&!os.pending()&&(z||(P.value.enabled=_e.ollama.enabled,P.value.base_url=_e.ollama.base_url||"",P.value.model=_e.ollama.model||"",P.value.max_tokens=_e.ollama.max_tokens||4096),pe||(P.value.timeout=_e.ollama.timeout??P.value.timeout)),_e.kimi&&!Ye.pending()&&(z||(R.value.enabled=_e.kimi.enabled,R.value.model=_e.kimi.model||"",R.value.max_tokens=_e.kimi.max_tokens||4096),pe||(R.value.timeout=_e.kimi.timeout??R.value.timeout)),_e.auxiliary&&(b.value=_e.auxiliary,rs.pending()||(p.value.enabled=_e.auxiliary.enabled,p.value.model=_e.auxiliary.model||"gpt-5.6-luna"))}catch{t.value={active_provider:"codex",codex:{configured:!1},ollama:{configured:!1},kimi:{configured:!1}}}}async function Re(){const z=++T;_.value=!0,S.value="";try{const pe=await G.get("/api/context/windows");if(z!==T)return;m.value=pe,!U.value&&!w.value&&(n.value.context_budget_overrides=Object.fromEntries(Object.entries(pe.models||{}).filter(([,_e])=>_e.override!=null).map(([_e,Nt])=>[_e,Nt.override])),n.value.context_utilization=pe.utilization??n.value.context_utilization)}catch(pe){z===T&&(S.value=pe.message||"Failed to load context budgets")}finally{z===T&&(_.value=!1)}}async function Ve(){try{if(ke.value=await G.get("/api/ollama/status"),ke.value.model&&(he.value=ke.value.model),ke.value.configured)try{const z=await G.get("/api/ollama/models");ie.value=z.models||[]}catch{ie.value=[]}else if(P.value.base_url)try{const z=await G.post("/api/ollama/probe-models",{base_url:P.value.base_url});ie.value=z.models||[]}catch{ie.value=[]}}catch{ke.value={configured:!1}}}async function Pe(){ge.value=!0,He.value="";try{k.value=await G.get("/api/codex/status")}catch(z){He.value=z.message||"Failed to fetch Codex status"}finally{ge.value=!1}}async function pt(){const z=t.value?t.value.active_provider:"codex";we.value=!0;try{const pe=await G.post("/api/llm/switch",{provider:s.value});pe.error?(s.value=z,ne(pe.error,"error")):(ne("Switched to "+s.value+" ("+pe.model+")"),await xe())}catch(pe){s.value=z,ne(pe.message||"Switch failed","error")}finally{we.value=!1}}async function ls(){F.value=!0;try{const z=await G.post("/api/ollama/reload");ne(z.configured?"Ollama reloaded":z.reason||"Ollama not configured",z.configured?"success":"error"),await xe()}catch(z){ne(z.message||"Reload failed","error")}finally{F.value=!1}}async function Ps(){se.value=!0;try{await G.post("/api/ollama/model",{model:he.value}),ne("Model set to "+he.value),await xe()}catch(z){ne(z.message||"Failed","error")}finally{se.value=!1}}async function nn(){const z=P.value.base_url;if(!z){ne("Enter a base URL first","error");return}Y.value=!0;try{const pe=await G.post("/api/ollama/probe-models",{base_url:z});ie.value=pe.models||[],ie.value.length?(ne(ie.value.length+" model(s) found"),!P.value.model&&ie.value.length&&(P.value.model=ie.value[0].name)):ne("No models found at "+z,"error")}catch(pe){ne(pe.message||"Could not reach Ollama","error")}finally{Y.value=!1}}async function Ss(){try{if(Se.value=await G.get("/api/kimi/status"),Se.value.model&&(de.value=Se.value.model),Se.value.configured)try{const z=await G.get("/api/kimi/models");V.value=z.models||[]}catch{V.value=[]}}catch{Se.value={configured:!1}}}async function Fs(){ce.value=!0;try{const z=await G.post("/api/kimi/reload");ne(z.configured?"Kimi reloaded":z.reason||"Kimi not configured",z.configured?"success":"error"),await xe()}catch(z){ne(z.message||"Reload failed","error")}finally{ce.value=!1}}async function Mt(){ye.value=!0;try{await G.post("/api/kimi/model",{model:de.value}),ne("Model set to "+de.value),await xe()}catch(z){ne(z.message||"Failed","error")}finally{ye.value=!1}}async function Yt(){if(U.value){Ct();return}U.value=!0;const z=Fu(n.value);try{await G.put("/api/llm/codex/config",z),ne("Codex config saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Pe()])}catch(pe){ne(pe.message||"Failed","error");const _e=JSON.stringify(Fu(n.value))!==JSON.stringify(z);await Promise.all([Ce({preserveBasic:_e,preserveAdvanced:!0}),Pe()])}finally{U.value=!1}}async function $s(){if(U.value)return;U.value=!0;const z=$u(n.value);try{await G.put("/api/llm/codex/config",z),JSON.stringify({context_budget_overrides:n.value.context_budget_overrides,context_utilization:n.value.context_utilization})===JSON.stringify({context_budget_overrides:z.context_budget_overrides,context_utilization:z.context_utilization})&&(w.value=!1),ne("Codex advanced settings saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Pe(),Re()])}catch(pe){ne(pe.message||"Failed","error");const _e=JSON.stringify($u(n.value))!==JSON.stringify(z);await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:_e}),Pe(),Re()])}finally{U.value=!1}}async function Bs(){if(O.value){os();return}O.value=!0;try{const z=j.value?P.value.api_key:null,pe=aw(P.value,{includeApiKey:z!==null});await G.put("/api/llm/ollama/config",pe),ne("Ollama config saved"),z!==null&&P.value.api_key===z&&(P.value.api_key="",j.value=!1),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ve()])}catch(z){ne(z.message||"Failed","error")}finally{O.value=!1}}async function An(){if(!O.value){O.value=!0;try{await G.put("/api/llm/ollama/config",iw(P.value)),ne("Ollama timeout saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ve()])}catch(z){ne(z.message||"Failed","error")}finally{O.value=!1}}}async function Us(){if(N.value){Ye();return}N.value=!0;try{const z=Q.value?R.value.api_key:null,pe=lw(R.value,{includeApiKey:z!==null});await G.put("/api/llm/kimi/config",pe),ne("Kimi config saved"),z!==null&&R.value.api_key===z&&(R.value.api_key="",Q.value=!1),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ss()])}catch(z){ne(z.message||"Failed","error")}finally{N.value=!1}}async function zt(){if(!N.value){N.value=!0;try{await G.put("/api/llm/kimi/config",rw(R.value)),ne("Kimi timeout saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ss()])}catch(z){ne(z.message||"Failed","error")}finally{N.value=!1}}}async function Vn(){if(I.value){rs();return}I.value=!0;try{await G.put("/api/llm/auxiliary/config",p.value),ne("Auxiliary config saved"),await Ce()}catch(z){ne(z.message||"Failed","error"),await Ce()}finally{I.value=!1}}const Ct=kl(Yt),rs=kl(Vn),os=kl(Bs),Ye=kl(Us),gs=()=>(Ct.cancel(),Yt()),q=()=>(os.cancel(),Bs()),re=()=>(Ye.cancel(),Us()),Ee=()=>$s(),Ze=()=>An(),lt=()=>zt();async function Ot(z){const pe=z.account_key+":"+z.model;g.value=pe;try{const _e=await G.post("/api/context/windows/clear",{account_key:z.account_key,model:z.model});ne(_e.cleared?"Temporary clamp cleared":"Clamp was already inactive"),await Re()}catch(_e){ne(_e.message||"Failed to clear clamp","error"),await Re()}finally{g.value=null}}async function Pt(z){try{await G.post("/api/codex/account/"+z+"/activate"),ne("Active account switched"),await Pe()}catch(pe){ne(pe.message||"Failed","error")}}async function ma(z){L.value=z;try{await G.post("/api/codex/account/"+z+"/refresh"),ne("Token refreshed"),await Pe()}catch(pe){ne(pe.message||"Refresh failed","error")}finally{L.value=null}}function Ts(z,pe){$.value=z,ee.value=pe||""}async function ga(z){try{await G.put("/api/codex/account/"+z+"/label",{label:ee.value}),ne("Label updated"),$.value=null,await Pe()}catch(pe){ne(pe.message||"Failed","error")}}async function ni(z,pe){if(await _s({title:"Delete Codex account",message:`Delete ${pe||"account #"+(z+1)}? The pool will reload without it.`,confirmLabel:"Delete",danger:!0}))try{await G.del("/api/codex/account/"+z),ne("Deleted. Pool reloaded."),await Pe()}catch(Nt){ne(Nt.message||"Failed","error")}}async function va(){X.value=!0;try{const z=await G.post("/api/codex/device-code");ue.value=z,Z.value="pending",ba(z)}catch(z){ne(z.message||"Failed","error")}finally{X.value=!1}}async function ba(z){te={cancelled:!1};const pe=te;try{const _e=await G.post("/api/codex/device-poll",{device_auth_id:z.device_auth_id,user_code:z.user_code,interval:z.interval});if(pe.cancelled)return;oe.value=_e,Z.value="success",await xe()}catch(_e){if(pe.cancelled)return;le.value=_e.message||"Device login failed",Z.value="error"}}function Gs(){te&&(te.cancelled=!0),Z.value=null,ue.value=null}return We(xe),xt(()=>{te&&(te.cancelled=!0),Ct.cancel(),rs.cancel(),os.cancel(),Ye.cancel()}),{loading:e,llmStatus:t,selectedProvider:s,switching:we,advancedOpen:x,codexForm:n,codexModelOptions:i,codexAgentModelOptions:l,mainMaxAllowed:o,agentMaxAllowed:c,mainModelOptionDisabled:u,agentModelOptionDisabled:f,auxForm:p,auxData:b,auxModelOptions:y,onAuxModelChange:E,savingAux:I,saveAuxConfigDebounced:rs,ollamaForm:P,kimiForm:R,savingCodex:U,savingOllama:O,savingKimi:N,probingOllama:Y,ollamaKeyDirty:j,kimiKeyDirty:Q,ollamaStatus:ke,ollamaModels:ie,ollamaSelectedModel:he,reloading:F,settingModel:se,kimiStatus:Se,kimiModels:V,kimiSelectedModel:de,reloadingKimi:ce,settingKimiModel:ye,codexLoading:ge,codexError:He,codexData:k,refreshing:L,editingLabel:$,labelValue:ee,contextWindows:m,contextWindowsLoading:_,contextWindowsError:S,contextBudgetRows:C,activeClampRows:M,activeContextBudget:H,clearingClamp:g,contextPolicyDirty:w,deviceState:Z,deviceLoading:X,deviceInfo:ue,deviceResult:oe,deviceError:le,fetchAll:xe,switchProvider:pt,reloadOllama:ls,setOllamaModel:Ps,reloadKimi:Fs,setKimiModel:Mt,probeOllamaModels:nn,saveCodexConfig:Yt,saveOllamaConfig:Bs,saveKimiConfig:Us,saveCodexAdvancedConfig:$s,saveOllamaAdvancedConfig:An,saveKimiAdvancedConfig:zt,saveCodexConfigDebounced:Ct,saveOllamaConfigDebounced:os,saveKimiConfigDebounced:Ye,saveCodexConfigNow:gs,saveOllamaConfigNow:q,saveKimiConfigNow:re,saveCodexAdvancedConfigNow:Ee,saveOllamaAdvancedConfigNow:Ze,saveKimiAdvancedConfigNow:lt,activateAccount:Pt,refreshAccount:ma,startEditLabel:Ts,saveLabel:ga,deleteAccount:ni,startDeviceLogin:va,cancelDeviceLogin:Gs,formatSize:fe,fetchContextWindows:Re,clearContextClamp:Ot,setContextOverride:qe,setContextUtilization:ct,resetContextOverride:K,overrideAboveFloor:Be,formatCount:ve,formatContextCeiling:Te,formatExpiry:Oe,shortAccountKey:Le,provenanceClass:De}}},Bu={ok:"text-green-400",pass:"text-green-400",degraded:"text-yellow-400",warn:"text-yellow-400",down:"text-red-400",fail:"text-red-400",unconfigured:"text-gray-500",skipped:"text-gray-500"};function cw(e){return Bu[e]||Bu[(e||"").toLowerCase()]||"text-gray-400"}const dw={template:` + `,setup(){const e=h(!0),t=h(null),s=h("codex"),n=h({enabled:!1,model:"gpt-5.6-sol",reasoning_effort:"xhigh",agent_reasoning_effort:"auto",agent_model:"auto",request_timeout_seconds:3600,stream_stall_timeout_seconds:180,retry:{max_retries:3,base_delay:1,max_delay:30},connection_pool:{max_connections:10,keepalive_timeout:30},context_compression:{enabled:!0,max_context_chars:null,keep_recent_iterations:30},context_budget_overrides:{},context_utilization:60}),a=["gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-5.5"],i=J(()=>{const z=n.value.model;return z&&!a.includes(z)?[z,...a]:a}),l=J(()=>{const z=n.value.agent_model;return z&&z!=="auto"&&!a.includes(z)?[z,...a]:a}),r=["gpt-5.5","gpt-5.4","gpt-5.4-mini"],o=J(()=>!r.includes(n.value.model)&&!(r.includes(n.value.agent_model)&&n.value.agent_reasoning_effort==="")),c=J(()=>{const z=n.value.agent_model;return z==="auto"?!0:!r.includes(z||n.value.model)}),d=J(()=>{const z=n.value.agent_reasoning_effort;return z==="auto"?!1:(z||n.value.reasoning_effort)==="max"}),u=z=>r.includes(z)&&(n.value.reasoning_effort==="max"||n.value.agent_model===""&&d.value),p=z=>r.includes(z)&&d.value,f=h({enabled:!1,model:"gpt-5.6-luna"}),b=h({unavailable_reason:null}),y=J(()=>{const z=f.value.model;return z&&!a.includes(z)?[z,...a]:a});function E(z){const fe=z.target.value;f.value.enabled=fe!=="",fe!==""&&(f.value.model=fe),rs()}const O=h(!1),x=h({codex:!1,ollama:!1,kimi:!1}),m=h(null),_=h(!1),S=h(""),g=h(null),w=h(!1);let T=0;const C=J(()=>{var z;return Object.entries(((z=m.value)==null?void 0:z.models)||{}).map(([fe,ke])=>{var Nt,Cs,jn;return{model:fe,floor:ke.floor,override:ke.override,effectiveBudget:(Nt=ke.effective)==null?void 0:Nt.effective_budget,configuredPrimaryChars:(Cs=ke.configured)==null?void 0:Cs.primary_chars,primaryChars:(jn=ke.effective)==null?void 0:jn.primary_chars,provenance:ke.provenance,clampExpiresAt:ke.clamp_expires_at}})}),M=J(()=>{var z;return((z=m.value)==null?void 0:z.clamps)||[]}),H=J(()=>{var z,fe;return((fe=(z=m.value)==null?void 0:z.models)==null?void 0:fe[n.value.model])||null}),P=h({enabled:!1,base_url:"",model:"",api_key:"",max_tokens:4096,timeout:300}),R=h({enabled:!1,api_key:"",model:"",max_tokens:4096,timeout:300}),V=h(!1),Q=h(!1),U=h(!1),N=h(!1),I=h(!1),Y=h(!1),Se=h(!1),we=h({configured:!1}),re=h([]),he=h(""),se=h(!1),me=h(!1),W=h({configured:!1}),B=h([]),ie=h(""),le=h(!1),xe=h(!1),ge=h(!0),Fe=h(""),k=h({configured:!1,accounts:[]}),L=h(null),F=h(null),ee=h(""),Z=h(null),X=h(!1),ue=h(null),de=h(null),oe=h("");let te=null;function ne(z,fe="success"){Ee(z,fe==="error"?"error":"success")}function pe(z){if(!z)return"?";const fe=z/(1024*1024*1024);return fe>=1?fe.toFixed(1)+" GB":(z/(1024*1024)).toFixed(0)+" MB"}function be(z){return Number.isFinite(Number(z))?Number(z).toLocaleString():"—"}function Te(z){return z==null?"automatic (model-derived)":Number(z).toLocaleString()+" characters"}function Oe(z){const fe=new Date(z);return Number.isNaN(fe.getTime())?"unknown":fe.toLocaleString([],{dateStyle:"medium",timeStyle:"short"})}function Le(z){return typeof z=="string"&&z.length>12?z.slice(0,8)+"…"+z.slice(-4):z}function De(z){return z==="temporary learned clamp"?"is-clamp":z==="override"?"is-override":"is-built-in"}function Be(z){const fe=n.value.context_budget_overrides[z.model];return z.floor!=null&&Number.isFinite(Number(fe))&&Number(fe)>z.floor}function qe(z,fe){const ke={...n.value.context_budget_overrides};fe.target.value===""?delete ke[z]:ke[z]=Number(fe.target.value),n.value.context_budget_overrides=ke,w.value=!0}function ct(z){n.value.context_utilization=z.target.value===""?"":Number(z.target.value),w.value=!0}function G(z){const fe={...n.value.context_budget_overrides};delete fe[z],n.value.context_budget_overrides=fe,w.value=!0}async function _e(){e.value=!0,await Promise.all([Ce(),Ve(),Ss(),Pe(),Re()]),e.value=!1}async function Ce({preserveBasic:z=!1,preserveAdvanced:fe=!1}={}){try{const ke=await q.get("/api/llm/status");t.value=ke,s.value=ke.active_provider||"codex",ke.codex&&!Ct.pending()&&(z||(n.value.enabled=ke.codex.enabled,n.value.model=ke.codex.model||"gpt-5.6-sol",n.value.reasoning_effort=ke.codex.reasoning_effort||"medium",n.value.agent_reasoning_effort=ke.codex.agent_reasoning_effort||"",n.value.agent_model=ke.codex.agent_model||""),fe||(n.value.request_timeout_seconds=ke.codex.request_timeout_seconds??n.value.request_timeout_seconds,n.value.stream_stall_timeout_seconds=ke.codex.stream_stall_timeout_seconds??n.value.stream_stall_timeout_seconds,n.value.retry={...n.value.retry,...ke.codex.retry||{}},n.value.connection_pool={...n.value.connection_pool,...ke.codex.connection_pool||{}},n.value.context_compression={...n.value.context_compression,...ke.codex.context_compression||{}},!w.value&&!U.value&&(n.value.context_budget_overrides={...ke.codex.context_budget_overrides||{}},n.value.context_utilization=ke.codex.context_utilization??n.value.context_utilization))),ke.ollama&&!os.pending()&&(z||(P.value.enabled=ke.ollama.enabled,P.value.base_url=ke.ollama.base_url||"",P.value.model=ke.ollama.model||"",P.value.max_tokens=ke.ollama.max_tokens||4096),fe||(P.value.timeout=ke.ollama.timeout??P.value.timeout)),ke.kimi&&!Ye.pending()&&(z||(R.value.enabled=ke.kimi.enabled,R.value.model=ke.kimi.model||"",R.value.max_tokens=ke.kimi.max_tokens||4096),fe||(R.value.timeout=ke.kimi.timeout??R.value.timeout)),ke.auxiliary&&(b.value=ke.auxiliary,rs.pending()||(f.value.enabled=ke.auxiliary.enabled,f.value.model=ke.auxiliary.model||"gpt-5.6-luna"))}catch{t.value={active_provider:"codex",codex:{configured:!1},ollama:{configured:!1},kimi:{configured:!1}}}}async function Re(){const z=++T;_.value=!0,S.value="";try{const fe=await q.get("/api/context/windows");if(z!==T)return;m.value=fe,!U.value&&!w.value&&(n.value.context_budget_overrides=Object.fromEntries(Object.entries(fe.models||{}).filter(([,ke])=>ke.override!=null).map(([ke,Nt])=>[ke,Nt.override])),n.value.context_utilization=fe.utilization??n.value.context_utilization)}catch(fe){z===T&&(S.value=fe.message||"Failed to load context budgets")}finally{z===T&&(_.value=!1)}}async function Ve(){try{if(we.value=await q.get("/api/ollama/status"),we.value.model&&(he.value=we.value.model),we.value.configured)try{const z=await q.get("/api/ollama/models");re.value=z.models||[]}catch{re.value=[]}else if(P.value.base_url)try{const z=await q.post("/api/ollama/probe-models",{base_url:P.value.base_url});re.value=z.models||[]}catch{re.value=[]}}catch{we.value={configured:!1}}}async function Pe(){ge.value=!0,Fe.value="";try{k.value=await q.get("/api/codex/status")}catch(z){Fe.value=z.message||"Failed to fetch Codex status"}finally{ge.value=!1}}async function ft(){const z=t.value?t.value.active_provider:"codex";Se.value=!0;try{const fe=await q.post("/api/llm/switch",{provider:s.value});fe.error?(s.value=z,ne(fe.error,"error")):(ne("Switched to "+s.value+" ("+fe.model+")"),await _e())}catch(fe){s.value=z,ne(fe.message||"Switch failed","error")}finally{Se.value=!1}}async function ls(){se.value=!0;try{const z=await q.post("/api/ollama/reload");ne(z.configured?"Ollama reloaded":z.reason||"Ollama not configured",z.configured?"success":"error"),await _e()}catch(z){ne(z.message||"Reload failed","error")}finally{se.value=!1}}async function Ps(){me.value=!0;try{await q.post("/api/ollama/model",{model:he.value}),ne("Model set to "+he.value),await _e()}catch(z){ne(z.message||"Failed","error")}finally{me.value=!1}}async function nn(){const z=P.value.base_url;if(!z){ne("Enter a base URL first","error");return}Y.value=!0;try{const fe=await q.post("/api/ollama/probe-models",{base_url:z});re.value=fe.models||[],re.value.length?(ne(re.value.length+" model(s) found"),!P.value.model&&re.value.length&&(P.value.model=re.value[0].name)):ne("No models found at "+z,"error")}catch(fe){ne(fe.message||"Could not reach Ollama","error")}finally{Y.value=!1}}async function Ss(){try{if(W.value=await q.get("/api/kimi/status"),W.value.model&&(ie.value=W.value.model),W.value.configured)try{const z=await q.get("/api/kimi/models");B.value=z.models||[]}catch{B.value=[]}}catch{W.value={configured:!1}}}async function Fs(){le.value=!0;try{const z=await q.post("/api/kimi/reload");ne(z.configured?"Kimi reloaded":z.reason||"Kimi not configured",z.configured?"success":"error"),await _e()}catch(z){ne(z.message||"Reload failed","error")}finally{le.value=!1}}async function Mt(){xe.value=!0;try{await q.post("/api/kimi/model",{model:ie.value}),ne("Model set to "+ie.value),await _e()}catch(z){ne(z.message||"Failed","error")}finally{xe.value=!1}}async function Yt(){if(U.value){Ct();return}U.value=!0;const z=Fu(n.value);try{await q.put("/api/llm/codex/config",z),ne("Codex config saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Pe()])}catch(fe){ne(fe.message||"Failed","error");const ke=JSON.stringify(Fu(n.value))!==JSON.stringify(z);await Promise.all([Ce({preserveBasic:ke,preserveAdvanced:!0}),Pe()])}finally{U.value=!1}}async function $s(){if(U.value)return;U.value=!0;const z=$u(n.value);try{await q.put("/api/llm/codex/config",z),JSON.stringify({context_budget_overrides:n.value.context_budget_overrides,context_utilization:n.value.context_utilization})===JSON.stringify({context_budget_overrides:z.context_budget_overrides,context_utilization:z.context_utilization})&&(w.value=!1),ne("Codex advanced settings saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Pe(),Re()])}catch(fe){ne(fe.message||"Failed","error");const ke=JSON.stringify($u(n.value))!==JSON.stringify(z);await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:ke}),Pe(),Re()])}finally{U.value=!1}}async function Us(){if(N.value){os();return}N.value=!0;try{const z=V.value?P.value.api_key:null,fe=aw(P.value,{includeApiKey:z!==null});await q.put("/api/llm/ollama/config",fe),ne("Ollama config saved"),z!==null&&P.value.api_key===z&&(P.value.api_key="",V.value=!1),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ve()])}catch(z){ne(z.message||"Failed","error")}finally{N.value=!1}}async function An(){if(!N.value){N.value=!0;try{await q.put("/api/llm/ollama/config",iw(P.value)),ne("Ollama timeout saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ve()])}catch(z){ne(z.message||"Failed","error")}finally{N.value=!1}}}async function Bs(){if(I.value){Ye();return}I.value=!0;try{const z=Q.value?R.value.api_key:null,fe=lw(R.value,{includeApiKey:z!==null});await q.put("/api/llm/kimi/config",fe),ne("Kimi config saved"),z!==null&&R.value.api_key===z&&(R.value.api_key="",Q.value=!1),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ss()])}catch(z){ne(z.message||"Failed","error")}finally{I.value=!1}}async function zt(){if(!I.value){I.value=!0;try{await q.put("/api/llm/kimi/config",rw(R.value)),ne("Kimi timeout saved"),await Promise.all([Ce({preserveBasic:!0,preserveAdvanced:!0}),Ss()])}catch(z){ne(z.message||"Failed","error")}finally{I.value=!1}}}async function Vn(){if(O.value){rs();return}O.value=!0;try{await q.put("/api/llm/auxiliary/config",f.value),ne("Auxiliary config saved"),await Ce()}catch(z){ne(z.message||"Failed","error"),await Ce()}finally{O.value=!1}}const Ct=kl(Yt),rs=kl(Vn),os=kl(Us),Ye=kl(Bs),gs=()=>(Ct.cancel(),Yt()),j=()=>(os.cancel(),Us()),ce=()=>(Ye.cancel(),Bs()),Ae=()=>$s(),Ze=()=>An(),lt=()=>zt();async function Ot(z){const fe=z.account_key+":"+z.model;g.value=fe;try{const ke=await q.post("/api/context/windows/clear",{account_key:z.account_key,model:z.model});ne(ke.cleared?"Temporary clamp cleared":"Clamp was already inactive"),await Re()}catch(ke){ne(ke.message||"Failed to clear clamp","error"),await Re()}finally{g.value=null}}async function Pt(z){try{await q.post("/api/codex/account/"+z+"/activate"),ne("Active account switched"),await Pe()}catch(fe){ne(fe.message||"Failed","error")}}async function ma(z){L.value=z;try{await q.post("/api/codex/account/"+z+"/refresh"),ne("Token refreshed"),await Pe()}catch(fe){ne(fe.message||"Refresh failed","error")}finally{L.value=null}}function Ts(z,fe){F.value=z,ee.value=fe||""}async function ga(z){try{await q.put("/api/codex/account/"+z+"/label",{label:ee.value}),ne("Label updated"),F.value=null,await Pe()}catch(fe){ne(fe.message||"Failed","error")}}async function ni(z,fe){if(await _s({title:"Delete Codex account",message:`Delete ${fe||"account #"+(z+1)}? The pool will reload without it.`,confirmLabel:"Delete",danger:!0}))try{await q.del("/api/codex/account/"+z),ne("Deleted. Pool reloaded."),await Pe()}catch(Nt){ne(Nt.message||"Failed","error")}}async function va(){X.value=!0;try{const z=await q.post("/api/codex/device-code");ue.value=z,Z.value="pending",ba(z)}catch(z){ne(z.message||"Failed","error")}finally{X.value=!1}}async function ba(z){te={cancelled:!1};const fe=te;try{const ke=await q.post("/api/codex/device-poll",{device_auth_id:z.device_auth_id,user_code:z.user_code,interval:z.interval});if(fe.cancelled)return;de.value=ke,Z.value="success",await _e()}catch(ke){if(fe.cancelled)return;oe.value=ke.message||"Device login failed",Z.value="error"}}function Gs(){te&&(te.cancelled=!0),Z.value=null,ue.value=null}return We(_e),xt(()=>{te&&(te.cancelled=!0),Ct.cancel(),rs.cancel(),os.cancel(),Ye.cancel()}),{loading:e,llmStatus:t,selectedProvider:s,switching:Se,advancedOpen:x,codexForm:n,codexModelOptions:i,codexAgentModelOptions:l,mainMaxAllowed:o,agentMaxAllowed:c,mainModelOptionDisabled:u,agentModelOptionDisabled:p,auxForm:f,auxData:b,auxModelOptions:y,onAuxModelChange:E,savingAux:O,saveAuxConfigDebounced:rs,ollamaForm:P,kimiForm:R,savingCodex:U,savingOllama:N,savingKimi:I,probingOllama:Y,ollamaKeyDirty:V,kimiKeyDirty:Q,ollamaStatus:we,ollamaModels:re,ollamaSelectedModel:he,reloading:se,settingModel:me,kimiStatus:W,kimiModels:B,kimiSelectedModel:ie,reloadingKimi:le,settingKimiModel:xe,codexLoading:ge,codexError:Fe,codexData:k,refreshing:L,editingLabel:F,labelValue:ee,contextWindows:m,contextWindowsLoading:_,contextWindowsError:S,contextBudgetRows:C,activeClampRows:M,activeContextBudget:H,clearingClamp:g,contextPolicyDirty:w,deviceState:Z,deviceLoading:X,deviceInfo:ue,deviceResult:de,deviceError:oe,fetchAll:_e,switchProvider:ft,reloadOllama:ls,setOllamaModel:Ps,reloadKimi:Fs,setKimiModel:Mt,probeOllamaModels:nn,saveCodexConfig:Yt,saveOllamaConfig:Us,saveKimiConfig:Bs,saveCodexAdvancedConfig:$s,saveOllamaAdvancedConfig:An,saveKimiAdvancedConfig:zt,saveCodexConfigDebounced:Ct,saveOllamaConfigDebounced:os,saveKimiConfigDebounced:Ye,saveCodexConfigNow:gs,saveOllamaConfigNow:j,saveKimiConfigNow:ce,saveCodexAdvancedConfigNow:Ae,saveOllamaAdvancedConfigNow:Ze,saveKimiAdvancedConfigNow:lt,activateAccount:Pt,refreshAccount:ma,startEditLabel:Ts,saveLabel:ga,deleteAccount:ni,startDeviceLogin:va,cancelDeviceLogin:Gs,formatSize:pe,fetchContextWindows:Re,clearContextClamp:Ot,setContextOverride:qe,setContextUtilization:ct,resetContextOverride:G,overrideAboveFloor:Be,formatCount:be,formatContextCeiling:Te,formatExpiry:Oe,shortAccountKey:Le,provenanceClass:De}}},Uu={ok:"text-green-400",pass:"text-green-400",degraded:"text-yellow-400",warn:"text-yellow-400",down:"text-red-400",fail:"text-red-400",unconfigured:"text-gray-500",skipped:"text-gray-500"};function cw(e){return Uu[e]||Uu[(e||"").toLowerCase()]||"text-gray-400"}const dw={template:`
@@ -5448,7 +5471,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h(!0),t=h({}),s=h([]),n=h({}),a=h({}),i=h(null),l=h(null),r=h(null),o=h(null),c=h(null),d=J(()=>{var g;return Object.values(((g=i.value)==null?void 0:g.totals)||{}).reduce((w,T)=>w+Number(T||0),0)}),u=h(""),f=h(0),p=h([]),b=J(()=>p.value.map(g=>`${g.label} (${g.path}${g.reason?`: ${g.reason}`:""})`).join("; ")),y=Object.freeze([{key:"startup",label:"Startup diagnostics",path:"/api/startup/diagnostics"},{key:"subsystems",label:"Subsystem status",path:"/api/subsystems/status"},{key:"sshPool",label:"SSH pool",path:"/api/pools/ssh"},{key:"httpPool",label:"HTTP pool",path:"/api/pools/http"},{key:"riskStats",label:"Risk stats",path:"/api/risk/stats"},{key:"recoveryStats",label:"Recovery stats",path:"/api/recovery/stats"},{key:"compressionStats",label:"Compression stats",path:"/api/compression/stats"},{key:"freshnessStats",label:"Freshness stats",path:"/api/freshness/stats"},{key:"governorStats",label:"Governor stats",path:"/api/governor/stats"}]);let E=null;async function I(){var M;const g=await Promise.allSettled(y.map(H=>G.get(H.path))),w=H=>g[H].status==="fulfilled"?g[H].value:null;t.value=w(0)||{};const T=w(1);s.value=Array.isArray(T)?T:T&&T.subsystems||[],n.value=w(2)||{},a.value=w(3)||{},i.value=w(4),l.value=w(5),r.value=w(6),o.value=w(7),c.value=w(8);const C=g.filter(H=>H.status==="rejected");if(p.value=g.flatMap((H,P)=>{var R;return H.status==="rejected"?[{...y[P],reason:((R=H.reason)==null?void 0:R.message)||"request failed"}]:[]}),f.value=p.value.length,C.length===g.length){const H=(M=C[0])==null?void 0:M.reason;u.value=(H==null?void 0:H.message)||"Failed to load internals"}else u.value="";e.value=!1}function x(){e.value=!0,u.value="",I()}let m=!1;function _(){m||(m=!0,I(),E||(E=setInterval(I,3e4)))}function S(){m&&(m=!1,E&&(clearInterval(E),E=null))}return We(_),Ds(_),Ms(S),xt(S),{loading:e,error:u,failedCount:f,failedEndpoints:p,failedEndpointSummary:b,endpoints:y,retry:x,startup:t,subsystems:s,sshPool:n,httpPool:a,riskStats:i,riskTotal:d,recoveryStats:l,compressionStats:r,freshnessStats:o,governorStats:c,statusColor:cw,formatAgeSeconds:X_}}},uw={setup(){const e=h(""),t=h(""),s=h(!1),n=h(""),a=h(!1),i=h(!1),l=h(!1),r=h(null),o=h(!1);async function c(){a.value=!0,r.value=null,o.value=!1;try{const u=await G.get("/api/update/check");e.value=u.current||"",t.value=u.latest||"",s.value=u.update_available||!1,n.value=u.changelog||"",u.error&&(r.value=u.error),o.value=!0}catch(u){r.value=u.message}finally{a.value=!1}}async function d(){if(await _s({title:"Update & restart",message:"Update Odin and restart? Active tasks will be interrupted.",confirmLabel:"Update & Restart",danger:!0})){i.value=!0,r.value=null;try{await G.post("/api/update/apply",{version:"latest"}),l.value=!0,setTimeout(()=>location.reload(),8e3)}catch(f){r.value=f.message}finally{i.value=!1}}}return We(c),{current:e,latest:t,updateAvailable:s,changelog:n,checking:a,applying:i,applied:l,error:r,checkDone:o,checkUpdate:c,applyUpdate:d}},template:` + `,setup(){const e=h(!0),t=h({}),s=h([]),n=h({}),a=h({}),i=h(null),l=h(null),r=h(null),o=h(null),c=h(null),d=J(()=>{var g;return Object.values(((g=i.value)==null?void 0:g.totals)||{}).reduce((w,T)=>w+Number(T||0),0)}),u=h(""),p=h(0),f=h([]),b=J(()=>f.value.map(g=>`${g.label} (${g.path}${g.reason?`: ${g.reason}`:""})`).join("; ")),y=Object.freeze([{key:"startup",label:"Startup diagnostics",path:"/api/startup/diagnostics"},{key:"subsystems",label:"Subsystem status",path:"/api/subsystems/status"},{key:"sshPool",label:"SSH pool",path:"/api/pools/ssh"},{key:"httpPool",label:"HTTP pool",path:"/api/pools/http"},{key:"riskStats",label:"Risk stats",path:"/api/risk/stats"},{key:"recoveryStats",label:"Recovery stats",path:"/api/recovery/stats"},{key:"compressionStats",label:"Compression stats",path:"/api/compression/stats"},{key:"freshnessStats",label:"Freshness stats",path:"/api/freshness/stats"},{key:"governorStats",label:"Governor stats",path:"/api/governor/stats"}]);let E=null;async function O(){var M;const g=await Promise.allSettled(y.map(H=>q.get(H.path))),w=H=>g[H].status==="fulfilled"?g[H].value:null;t.value=w(0)||{};const T=w(1);s.value=Array.isArray(T)?T:T&&T.subsystems||[],n.value=w(2)||{},a.value=w(3)||{},i.value=w(4),l.value=w(5),r.value=w(6),o.value=w(7),c.value=w(8);const C=g.filter(H=>H.status==="rejected");if(f.value=g.flatMap((H,P)=>{var R;return H.status==="rejected"?[{...y[P],reason:((R=H.reason)==null?void 0:R.message)||"request failed"}]:[]}),p.value=f.value.length,C.length===g.length){const H=(M=C[0])==null?void 0:M.reason;u.value=(H==null?void 0:H.message)||"Failed to load internals"}else u.value="";e.value=!1}function x(){e.value=!0,u.value="",O()}let m=!1;function _(){m||(m=!0,O(),E||(E=setInterval(O,3e4)))}function S(){m&&(m=!1,E&&(clearInterval(E),E=null))}return We(_),Ds(_),Ms(S),xt(S),{loading:e,error:u,failedCount:p,failedEndpoints:f,failedEndpointSummary:b,endpoints:y,retry:x,startup:t,subsystems:s,sshPool:n,httpPool:a,riskStats:i,riskTotal:d,recoveryStats:l,compressionStats:r,freshnessStats:o,governorStats:c,statusColor:cw,formatAgeSeconds:X_}}},uw={setup(){const e=h(""),t=h(""),s=h(!1),n=h(""),a=h(!1),i=h(!1),l=h(!1),r=h(null),o=h(!1);async function c(){a.value=!0,r.value=null,o.value=!1;try{const u=await q.get("/api/update/check");e.value=u.current||"",t.value=u.latest||"",s.value=u.update_available||!1,n.value=u.changelog||"",u.error&&(r.value=u.error),o.value=!0}catch(u){r.value=u.message}finally{a.value=!1}}async function d(){if(await _s({title:"Update & restart",message:"Update Odin and restart? Active tasks will be interrupted.",confirmLabel:"Update & Restart",danger:!0})){i.value=!0,r.value=null;try{await q.post("/api/update/apply",{version:"latest"}),l.value=!0,setTimeout(()=>location.reload(),8e3)}catch(p){r.value=p.message}finally{i.value=!1}}}return We(c),{current:e,latest:t,updateAvailable:s,changelog:n,checking:a,applying:i,applied:l,error:r,checkDone:o,checkUpdate:c,applyUpdate:d}},template:`

Updates

@@ -5503,7 +5526,7 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config

{{ error }}

- `},Im=[{id:"health",label:"Health",component:Ok},{id:"resources",label:"Resources",component:Nk},{id:"logs",label:"Logs",component:Pk},{id:"config",label:"Config",component:Wk},{id:"discord",label:"Discord",component:Jk},{id:"host-access",label:"Host Access",component:Qk},{id:"api-tokens",label:"API Tokens",component:Xk},{id:"llm",label:"LLM Config",component:ow},{id:"internals",label:"Internals",component:dw},{id:"update",label:"Update",component:uw}],fw={components:{TabbedPage:Mr},setup(){return{tabs:Im}},template:''},wl=(e,t,s,n)=>n.map(({id:a,label:i})=>({group:e,label:i,icon:t,to:{path:s,query:{tab:a}}})),pw=[{group:"Workspace",label:"Dashboard",icon:"dashboard",to:{path:"/dashboard"}},{group:"Workspace",label:"Chat",icon:"chat",to:{path:"/chat"}},...wl("Operations","operations","/operations",_m),...wl("History","history","/history",km),...wl("Capabilities","capabilities","/capabilities",wm),{group:"Manage",label:"Personality",icon:"personality",to:{path:"/personality"}},...wl("System","system","/system",Im)],us=Hn({open:!1,query:"",selected:0});function Uu(){us.query="",us.selected=0,us.open=!0}function ro(){us.open=!1}function hw(e,t){const s=e.label.toLowerCase(),n=`${e.group} ${e.label}`.toLowerCase();return t?s.startsWith(t)?100:n.startsWith(t)?80:s.includes(t)?60:n.includes(t)?40:0:1}const mw={setup(){const e=pm(),t=h(null),s=J(()=>{const i=us.query.trim().toLowerCase();return pw.map(l=>({...l,_score:hw(l,i)})).filter(l=>l._score>0).sort((l,r)=>r._score-l._score)});ns(()=>us.open,async i=>{var l;i&&(await Rt(),(l=t.value)==null||l.focus())}),ns(()=>us.query,()=>{us.selected=0});function n(i){ro(),e.push(i.to)}function a(i){if(i.key==="Escape"){i.preventDefault(),ro();return}if(i.key==="ArrowDown")i.preventDefault(),us.selected=Math.min(us.selected+1,s.value.length-1);else if(i.key==="ArrowUp")i.preventDefault(),us.selected=Math.max(us.selected-1,0);else if(i.key==="Enter"){i.preventDefault();const l=s.value[us.selected];l&&n(l)}}return{state:us,results:s,inputEl:t,go:n,onKeydown:a,closePalette:ro}},template:` + `},Im=[{id:"health",label:"Health",component:Ok},{id:"resources",label:"Resources",component:Nk},{id:"logs",label:"Logs",component:Pk},{id:"config",label:"Config",component:Wk},{id:"discord",label:"Discord",component:Jk},{id:"host-access",label:"Host Access",component:Qk},{id:"api-tokens",label:"API Tokens",component:Xk},{id:"llm",label:"LLM Config",component:ow},{id:"internals",label:"Internals",component:dw},{id:"update",label:"Update",component:uw}],pw={components:{TabbedPage:Mr},setup(){return{tabs:Im}},template:''},wl=(e,t,s,n)=>n.map(({id:a,label:i})=>({group:e,label:i,icon:t,to:{path:s,query:{tab:a}}})),fw=[{group:"Workspace",label:"Dashboard",icon:"dashboard",to:{path:"/dashboard"}},{group:"Workspace",label:"Chat",icon:"chat",to:{path:"/chat"}},...wl("Operations","operations","/operations",_m),...wl("History","history","/history",km),...wl("Capabilities","capabilities","/capabilities",wm),{group:"Manage",label:"Personality",icon:"personality",to:{path:"/personality"}},...wl("System","system","/system",Im)],us=Hn({open:!1,query:"",selected:0});function Bu(){us.query="",us.selected=0,us.open=!0}function ro(){us.open=!1}function hw(e,t){const s=e.label.toLowerCase(),n=`${e.group} ${e.label}`.toLowerCase();return t?s.startsWith(t)?100:n.startsWith(t)?80:s.includes(t)?60:n.includes(t)?40:0:1}const mw={setup(){const e=fm(),t=h(null),s=J(()=>{const i=us.query.trim().toLowerCase();return fw.map(l=>({...l,_score:hw(l,i)})).filter(l=>l._score>0).sort((l,r)=>r._score-l._score)});ns(()=>us.open,async i=>{var l;i&&(await Rt(),(l=t.value)==null||l.focus())}),ns(()=>us.query,()=>{us.selected=0});function n(i){ro(),e.push(i.to)}function a(i){if(i.key==="Escape"){i.preventDefault(),ro();return}if(i.key==="ArrowDown")i.preventDefault(),us.selected=Math.min(us.selected+1,s.value.length-1);else if(i.key==="ArrowUp")i.preventDefault(),us.selected=Math.max(us.selected-1,0);else if(i.key==="Enter"){i.preventDefault();const l=s.value[us.selected];l&&n(l)}}return{state:us,results:s,inputEl:t,go:n,onKeydown:a,closePalette:ro}},template:`
@@ -5715,10 +5738,10 @@ var Gm=Object.defineProperty;var Km=(e,t,s)=>t in e?Gm(e,t,{enumerable:!0,config
- `,setup(){const e=h({}),t=h(!0),s=h(null),n=h([]),a=h(!1),i=h([]),l=h(!1),r=h([]),o=h(0),c=h(null),d=h({reload:!1,clearSessions:!1,stopLoops:!1});let u=0;const f=J(()=>{const R=e.value.uptime_seconds||0,j=Math.floor(R/86400),Q=Math.floor(R%86400/3600),U=Math.floor(R%3600/60),O=[];return j>0&&O.push(`${j}d`),Q>0&&O.push(`${Q}h`),(O.length===0||j===0&&Q===0)&&O.push(`${U}m`),O.join(" ")}),p=J(()=>{const R=e.value.uptime_seconds||0;return 125.66*(1-Math.min(R/86400,1))}),b=J(()=>{const R=e.value;return[{label:"Guilds",value:R.guild_count??0,icon:"home",iconColor:"text-blue-400"},{label:"Sessions",value:R.session_count??0,icon:"message",iconColor:"text-yellow-400"},{label:"Tools",value:R.tool_count??0,icon:"wrench",iconColor:"text-purple-400",sub:`${R.skill_count??0} skills`,subColor:"text-gray-500"},{label:"Loops",value:R.loop_count??0,icon:"rotate",iconColor:"text-green-400",color:R.loop_count>0?"text-green-400":"",highlight:R.loop_count>0},{label:"Agents",value:R.agent_running??0,icon:"bot",iconColor:"text-cyan-400",sub:R.agent_count>0?`${R.agent_count} total`:"",subColor:"text-gray-500",highlight:(R.agent_running??0)>0},{label:"Processes",value:R.process_running??0,icon:"sliders",iconColor:"text-orange-400",sub:R.process_count>0?`${R.process_count} total`:"",subColor:"text-gray-500",highlight:(R.process_running??0)>0},{label:"Schedules",value:R.schedule_count??0,icon:"clock",iconColor:"text-amber-400",sub:(R.schedule_failing>0?`${R.schedule_failing} failing`:"")+(R.schedule_failing>0&&R.schedule_paused>0?", ":"")+(R.schedule_paused>0?`${R.schedule_paused} paused`:"")||void 0,subColor:R.schedule_failing>0?"text-red-400":"text-yellow-400",color:R.schedule_failing>0?"text-red-400":"",highlight:R.schedule_failing>0},{label:"Users",value:R.user_count??0,icon:"users",iconColor:"text-indigo-400"},...c.value!==null?[{label:"Knowledge",value:c.value,icon:"book",iconColor:"text-teal-400",sub:"chunks",subColor:"text-gray-500"}]:[]]}),y=J(()=>{const R=e.value,j=[];return j.push({label:"Bot",status:R.status==="online"?"ok":"warn",detail:R.status==="online"?"Online":"Starting"}),(R.schedule_failing||0)>0?j.push({label:"Schedules",status:"error",detail:`${R.schedule_failing} failing`}):(R.schedule_count||0)>0&&j.push({label:"Schedules",status:"ok",detail:`${R.schedule_count} configured`}),(R.loop_count||0)>0&&j.push({label:"Loops",status:"ok",detail:`${R.loop_count} active`}),(R.agent_running||0)>0&&j.push({label:"Agents",status:"ok",detail:`${R.agent_running} running`}),(R.process_running||0)>0&&j.push({label:"Processes",status:"ok",detail:`${R.process_running} running`}),j});async function E(){try{e.value=await G.get("/api/status"),s.value=null}catch(R){s.value=R.message}finally{t.value=!1}}async function I(){a.value=!0;try{n.value=await G.get("/api/audit?limit=10"),o.value=0}catch{}a.value=!1}async function x(){l.value=!0;try{i.value=await G.get("/api/audit?error_only=1&limit=5")}catch{}l.value=!1}async function m(){try{const R=await G.get("/api/knowledge");c.value=(Array.isArray(R)?R:[]).reduce((j,Q)=>j+(Q.chunks||0),0)}catch{c.value=null}}async function _(){try{const R=await G.get("/api/agents");r.value=R.filter(j=>j.status==="running")}catch{}}async function S(){d.value={...d.value,reload:!0};try{await G.post("/api/reload"),Ae.success("Config reloaded")}catch(R){Ae.error(R.message)}d.value={...d.value,reload:!1}}async function g(){if(!await _s({title:"Clear all sessions",message:"Clear all conversation sessions? This cannot be undone.",confirmLabel:"Clear All",danger:!0}))return;d.value={...d.value,clearSessions:!0};const j=e.value.session_count;e.value={...e.value,session_count:0};try{const Q=await G.post("/api/sessions/clear-all");Ae.success(`Cleared ${Q.count} session${Q.count!==1?"s":""}`),await E()}catch(Q){e.value={...e.value,session_count:j},Ae.error(Q.message)}d.value={...d.value,clearSessions:!1}}async function w(){if(!await _s({title:"Stop all loops",message:"Stop all running loops?",confirmLabel:"Stop Loops",danger:!0}))return;d.value={...d.value,stopLoops:!0};const j=e.value.loop_count;e.value={...e.value,loop_count:0};try{const Q=await G.post("/api/loops/stop-all");Ae.success(Q.result),await E()}catch(Q){e.value={...e.value,loop_count:j},Ae.error(Q.message)}d.value={...d.value,stopLoops:!1}}function T(){t.value=!0,s.value=null,E(),I(),x(),_()}let C=null,M=null,H=null;function P(R){if(R.payload&&R.payload.tool_name){const j={...R.payload,_isNew:!0,_key:++u};n.value.unshift(j),n.value.length>10&&n.value.pop(),o.value++,j.error&&(i.value.unshift(j),i.value.length>5&&i.value.pop()),setTimeout(()=>{j._isNew=!1},1500),clearTimeout(H),H=setTimeout(()=>{o.value=0},1e4)}}return We(async()=>{await Promise.all([E(),I(),x(),_(),m()]),C=setInterval(E,15e3),M=setInterval(_,1e4),Ke.subscribe("events",P)}),xt(()=>{C&&clearInterval(C),M&&clearInterval(M),clearTimeout(H),Ke.unsubscribe("events",P)}),{status:e,loading:t,error:s,uptime:f,uptimeRingOffset:p,stats:b,healthIndicators:y,activity:n,activityLoading:a,newEventCount:o,errors:i,errorsLoading:l,agents:r,actionLoading:d,fetchActivity:I,fetchStatus:E,formatTime:hm,formatDuration:Xa,retry:T,reloadConfig:S,clearSessions:g,stopAllLoops:w}}};/*! @license DOMPurify 3.4.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.9/LICENSE */function zu(e,t){(t==null||t>e.length)&&(t=e.length);for(var s=0,n=Array(t);s2?n-2:0),i=2;i1?s-1:0),a=1;a"u"?null:Tt(BigInt.prototype.toString),Wu=typeof Symbol>"u"?null:Tt(Symbol.prototype.toString),ht=Tt(Object.prototype.hasOwnProperty),pi=Tt(Object.prototype.toString),Ft=Tt(RegExp.prototype.test),Kn=Lw(TypeError);function Tt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:xi;if(Vu&&Vu(e,null),!Xt(t))return e;let n=t.length;for(;n--;){let a=t[n];if(typeof a=="string"){const i=s(a);i!==a&&(Tw(t)||(t[n]=i),a=i)}e[a]=!0}return e}function Dw(e){for(let t=0;t/g),Hw=Ls(/\${[\w\W]*/g),zw=Ls(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vw=Ls(/^aria-[\-\w]+$/),Xu=Ls(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jw=Ls(/^(?:\w+script|data):/i),qw=Ls(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gw=Ls(/^html$/i),Kw=Ls(/^[a-z][.\w]*(-[.\w]+)+$/i),Ks={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ww=function(){return typeof window>"u"?null:window},Zw=function(t,s){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(n=s.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ef=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ww();const t=me=>Lm(me);if(t.version="3.4.9",t.removed=[],!e||!e.document||e.document.nodeType!==Ks.document||!e.Element)return t.isSupported=!1,t;let s=e.document;const n=s,a=n.currentScript;e.DocumentFragment;const i=e.HTMLTemplateElement,l=e.Node,r=e.Element,o=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,u=e.trustedTypes,f=r.prototype,p=Zs(f,"cloneNode"),b=Zs(f,"remove"),y=Zs(f,"nextSibling"),E=Zs(f,"childNodes"),I=Zs(f,"parentNode"),x=Zs(f,"shadowRoot"),m=Zs(f,"attributes"),_=l&&l.prototype?Zs(l.prototype,"nodeType"):null,S=l&&l.prototype?Zs(l.prototype,"nodeName"):null;if(typeof i=="function"){const me=s.createElement("template");me.content&&me.content.ownerDocument&&(s=me.content.ownerDocument)}let g,w="",T,C=!1,M=0;const H=function(){if(M>0)throw Kn('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},P=function(A){H(),M++;try{return g.createHTML(A)}finally{M--}},R=function(A){H(),M++;try{return g.createScriptURL(A)}finally{M--}},j=function(){return C||(T=Zw(u,a),C=!0),T},Q=s,U=Q.implementation,O=Q.createNodeIterator,N=Q.createDocumentFragment,Y=Q.getElementsByTagName,we=n.importNode;let ke=ef();t.isSupported=typeof Om=="function"&&typeof I=="function"&&U&&U.createHTMLDocument!==void 0;const ie=Bw,he=Uw,F=Hw,se=zw,Se=Vw,V=jw,de=qw,ce=Kw;let ye=Xu,ge=null;const He=$e({},[...Zu,...co,...uo,...fo,...Ju]);let k=null;const L=$e({},[...Yu,...po,...Qu,...Sl]);let $=Object.seal(Ra(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}})),ee=null,Z=null;const X=Object.seal(Ra(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ue=!0,oe=!0,le=!1,te=!0,ne=!1,fe=!0,ve=!1,Te=!1,Oe=!1,Le=!1,De=!1,Be=!1,qe=!0,ct=!1;const K="user-content-";let xe=!0,Ce=!1,Re={},Ve=null;const Pe=$e({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let pt=null;const ls=$e({},["audio","video","img","source","image","track"]);let Ps=null;const nn=$e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ss="http://www.w3.org/1998/Math/MathML",Fs="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let Yt=Mt,$s=!1,Bs=null;const An=$e({},[Ss,Fs,Mt],oo);let Us=$e({},["mi","mo","mn","ms","mtext"]),zt=$e({},["annotation-xml"]);const Vn=$e({},["title","style","font","a","script"]);let Ct=null;const rs=["application/xhtml+xml","text/html"],os="text/html";let Ye=null,gs=null;const q=s.createElement("form"),re=function(A){return A instanceof RegExp||A instanceof Function},Ee=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gs&&gs===A)return;(!A||typeof A!="object")&&(A={}),A=qt(A),Ct=rs.indexOf(A.PARSER_MEDIA_TYPE)===-1?os:A.PARSER_MEDIA_TYPE,Ye=Ct==="application/xhtml+xml"?oo:xi,ge=ht(A,"ALLOWED_TAGS")&&Xt(A.ALLOWED_TAGS)?$e({},A.ALLOWED_TAGS,Ye):He,k=ht(A,"ALLOWED_ATTR")&&Xt(A.ALLOWED_ATTR)?$e({},A.ALLOWED_ATTR,Ye):L,Bs=ht(A,"ALLOWED_NAMESPACES")&&Xt(A.ALLOWED_NAMESPACES)?$e({},A.ALLOWED_NAMESPACES,oo):An,Ps=ht(A,"ADD_URI_SAFE_ATTR")&&Xt(A.ADD_URI_SAFE_ATTR)?$e(qt(nn),A.ADD_URI_SAFE_ATTR,Ye):nn,pt=ht(A,"ADD_DATA_URI_TAGS")&&Xt(A.ADD_DATA_URI_TAGS)?$e(qt(ls),A.ADD_DATA_URI_TAGS,Ye):ls,Ve=ht(A,"FORBID_CONTENTS")&&Xt(A.FORBID_CONTENTS)?$e({},A.FORBID_CONTENTS,Ye):Pe,ee=ht(A,"FORBID_TAGS")&&Xt(A.FORBID_TAGS)?$e({},A.FORBID_TAGS,Ye):qt({}),Z=ht(A,"FORBID_ATTR")&&Xt(A.FORBID_ATTR)?$e({},A.FORBID_ATTR,Ye):qt({}),Re=ht(A,"USE_PROFILES")?A.USE_PROFILES&&typeof A.USE_PROFILES=="object"?qt(A.USE_PROFILES):A.USE_PROFILES:!1,ue=A.ALLOW_ARIA_ATTR!==!1,oe=A.ALLOW_DATA_ATTR!==!1,le=A.ALLOW_UNKNOWN_PROTOCOLS||!1,te=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=A.SAFE_FOR_TEMPLATES||!1,fe=A.SAFE_FOR_XML!==!1,ve=A.WHOLE_DOCUMENT||!1,Le=A.RETURN_DOM||!1,De=A.RETURN_DOM_FRAGMENT||!1,Be=A.RETURN_TRUSTED_TYPE||!1,Oe=A.FORCE_BODY||!1,qe=A.SANITIZE_DOM!==!1,ct=A.SANITIZE_NAMED_PROPS||!1,xe=A.KEEP_CONTENT!==!1,Ce=A.IN_PLACE||!1,ye=Pw(A.ALLOWED_URI_REGEXP)?A.ALLOWED_URI_REGEXP:Xu,Yt=typeof A.NAMESPACE=="string"?A.NAMESPACE:Mt,Us=ht(A,"MATHML_TEXT_INTEGRATION_POINTS")&&A.MATHML_TEXT_INTEGRATION_POINTS&&typeof A.MATHML_TEXT_INTEGRATION_POINTS=="object"?qt(A.MATHML_TEXT_INTEGRATION_POINTS):$e({},["mi","mo","mn","ms","mtext"]),zt=ht(A,"HTML_INTEGRATION_POINTS")&&A.HTML_INTEGRATION_POINTS&&typeof A.HTML_INTEGRATION_POINTS=="object"?qt(A.HTML_INTEGRATION_POINTS):$e({},["annotation-xml"]);const W=ht(A,"CUSTOM_ELEMENT_HANDLING")&&A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING=="object"?qt(A.CUSTOM_ELEMENT_HANDLING):Ra(null);if($=Ra(null),ht(W,"tagNameCheck")&&re(W.tagNameCheck)&&($.tagNameCheck=W.tagNameCheck),ht(W,"attributeNameCheck")&&re(W.attributeNameCheck)&&($.attributeNameCheck=W.attributeNameCheck),ht(W,"allowCustomizedBuiltInElements")&&typeof W.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=W.allowCustomizedBuiltInElements),ne&&(oe=!1),De&&(Le=!0),Re&&(ge=$e({},Ju),k=Ra(null),Re.html===!0&&($e(ge,Zu),$e(k,Yu)),Re.svg===!0&&($e(ge,co),$e(k,po),$e(k,Sl)),Re.svgFilters===!0&&($e(ge,uo),$e(k,po),$e(k,Sl)),Re.mathMl===!0&&($e(ge,fo),$e(k,Qu),$e(k,Sl))),X.tagCheck=null,X.attributeCheck=null,ht(A,"ADD_TAGS")&&(typeof A.ADD_TAGS=="function"?X.tagCheck=A.ADD_TAGS:Xt(A.ADD_TAGS)&&(ge===He&&(ge=qt(ge)),$e(ge,A.ADD_TAGS,Ye))),ht(A,"ADD_ATTR")&&(typeof A.ADD_ATTR=="function"?X.attributeCheck=A.ADD_ATTR:Xt(A.ADD_ATTR)&&(k===L&&(k=qt(k)),$e(k,A.ADD_ATTR,Ye))),ht(A,"ADD_URI_SAFE_ATTR")&&Xt(A.ADD_URI_SAFE_ATTR)&&$e(Ps,A.ADD_URI_SAFE_ATTR,Ye),ht(A,"FORBID_CONTENTS")&&Xt(A.FORBID_CONTENTS)&&(Ve===Pe&&(Ve=qt(Ve)),$e(Ve,A.FORBID_CONTENTS,Ye)),ht(A,"ADD_FORBID_CONTENTS")&&Xt(A.ADD_FORBID_CONTENTS)&&(Ve===Pe&&(Ve=qt(Ve)),$e(Ve,A.ADD_FORBID_CONTENTS,Ye)),xe&&(ge["#text"]=!0),ve&&$e(ge,["html","head","body"]),ge.table&&($e(ge,["tbody"]),delete ee.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const v=g;g=A.TRUSTED_TYPES_POLICY;try{w=P("")}catch(D){throw g=v,D}}else A.TRUSTED_TYPES_POLICY===null?(g=void 0,w=""):(g===void 0&&(g=j()),g&&typeof w=="string"&&(w=P("")));(ke.uponSanitizeElement.length>0||ke.uponSanitizeAttribute.length>0)&&ge===He&&(ge=qt(ge)),ke.uponSanitizeAttribute.length>0&&k===L&&(k=qt(k)),is&&is(A),gs=A},Ze=$e({},[...co,...uo,...Fw]),lt=$e({},[...fo,...$w]),Ot=function(A){let W=I(A);(!W||!W.tagName)&&(W={namespaceURI:Yt,tagName:"template"});const v=xi(A.tagName),D=xi(W.tagName);return Bs[A.namespaceURI]?A.namespaceURI===Fs?W.namespaceURI===Mt?v==="svg":W.namespaceURI===Ss?v==="svg"&&(D==="annotation-xml"||Us[D]):!!Ze[v]:A.namespaceURI===Ss?W.namespaceURI===Mt?v==="math":W.namespaceURI===Fs?v==="math"&&zt[D]:!!lt[v]:A.namespaceURI===Mt?W.namespaceURI===Fs&&!zt[D]||W.namespaceURI===Ss&&!Us[D]?!1:!lt[v]&&(Vn[v]||!Ze[v]):!!(Ct==="application/xhtml+xml"&&Bs[A.namespaceURI]):!1},Pt=function(A){Sa(t.removed,{element:A});try{I(A).removeChild(A)}catch{if(b(A),!I(A))throw Kn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ma=function(A){const W=E?E(A):A.childNodes;if(W){const D=[];on(W,B=>{Sa(D,B)}),on(D,B=>{try{b(B)}catch{}})}const v=m?m(A):null;if(v)for(let D=v.length-1;D>=0;--D){const B=v[D],ae=B&&B.name;if(typeof ae=="string")try{A.removeAttribute(ae)}catch{}}},Ts=function(A,W){try{Sa(t.removed,{attribute:W.getAttributeNode(A),from:W})}catch{Sa(t.removed,{attribute:null,from:W})}if(W.removeAttribute(A),A==="is")if(Le||De)try{Pt(W)}catch{}else try{W.setAttribute(A,"")}catch{}},ga=function(A){const W=m?m(A):A.attributes;if(W)for(let v=W.length-1;v>=0;--v){const D=W[v],B=D&&D.name;if(!(typeof B!="string"||k[Ye(B)]))try{A.removeAttribute(B)}catch{}}},ni=function(A){const W=[A];for(;W.length>0;){const v=W.pop();(_?_(v):v.nodeType)===Ks.element&&ga(v);const B=E?E(v):v.childNodes;if(B)for(let ae=B.length-1;ae>=0;--ae)W.push(B[ae])}},va=function(A){let W=null,v=null;if(Oe)A=""+A;else{const ae=qu(A,/^[\r\n\t ]+/);v=ae&&ae[0]}Ct==="application/xhtml+xml"&&Yt===Mt&&(A=''+A+"");const D=g?P(A):A;if(Yt===Mt)try{W=new d().parseFromString(D,Ct)}catch{}if(!W||!W.documentElement){W=U.createDocument(Yt,"template",null);try{W.documentElement.innerHTML=$s?w:D}catch{}}const B=W.body||W.documentElement;return A&&v&&B.insertBefore(s.createTextNode(v),B.childNodes[0]||null),Yt===Mt?Y.call(W,ve?"html":"body")[0]:ve?W.documentElement:B},ba=function(A){return O.call(A.ownerDocument||A,A,o.SHOW_ELEMENT|o.SHOW_COMMENT|o.SHOW_TEXT|o.SHOW_PROCESSING_INSTRUCTION|o.SHOW_CDATA_SECTION,null)},Gs=function(A){var W,v;A.normalize();const D=O.call(A.ownerDocument||A,A,o.SHOW_TEXT|o.SHOW_COMMENT|o.SHOW_CDATA_SECTION|o.SHOW_PROCESSING_INSTRUCTION,null);let B=D.nextNode();for(;B;){let Ne=B.data;on([ie,he,F],Ue=>{Ne=Ta(Ne,Ue," ")}),B.data=Ne,B=D.nextNode()}const ae=(W=(v=A.querySelectorAll)===null||v===void 0?void 0:v.call(A,"template"))!==null&&W!==void 0?W:[];on(Array.from(ae),Ne=>{pe(Ne.content)&&Gs(Ne.content)})},z=function(A){const W=S?S(A):null;return typeof W!="string"||Ye(W)!=="form"?!1:typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||A.attributes!==m(A)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function"||A.nodeType!==_(A)||A.childNodes!==E(A)},pe=function(A){if(!_||typeof A!="object"||A===null)return!1;try{return _(A)===Ks.documentFragment}catch{return!1}},_e=function(A){if(!_||typeof A!="object"||A===null)return!1;try{return typeof _(A)=="number"}catch{return!1}};function Nt(me,A,W){on(me,v=>{v.call(t,A,W,gs)})}const Cs=function(A){let W=null;if(Nt(ke.beforeSanitizeElements,A,null),z(A))return Pt(A),!0;const v=Ye(S?S(A):A.nodeName);if(Nt(ke.uponSanitizeElement,A,{tagName:v,allowedTags:ge}),fe&&A.hasChildNodes()&&!_e(A.firstElementChild)&&Ft(/<[/\w!]/g,A.innerHTML)&&Ft(/<[/\w!]/g,A.textContent)||fe&&A.namespaceURI===Mt&&v==="style"&&_e(A.firstElementChild)||A.nodeType===Ks.progressingInstruction||fe&&A.nodeType===Ks.comment&&Ft(/<[/\w]/g,A.data))return Pt(A),!0;if(ee[v]||!(X.tagCheck instanceof Function&&X.tagCheck(v))&&!ge[v]){if(!ee[v]&&ai(v)&&($.tagNameCheck instanceof RegExp&&Ft($.tagNameCheck,v)||$.tagNameCheck instanceof Function&&$.tagNameCheck(v)))return!1;if(xe&&!Ve[v]){const B=I(A),ae=E(A);if(ae&&B){const Ne=ae.length;for(let Ue=Ne-1;Ue>=0;--Ue){const et=Ce?ae[Ue]:p(ae[Ue],!0);B.insertBefore(et,y(A))}}}return Pt(A),!0}return(_?_(A):A.nodeType)===Ks.element&&!Ot(A)||(v==="noscript"||v==="noembed"||v==="noframes")&&Ft(/<\/no(script|embed|frames)/i,A.innerHTML)?(Pt(A),!0):(ne&&A.nodeType===Ks.text&&(W=A.textContent,on([ie,he,F],B=>{W=Ta(W,B," ")}),A.textContent!==W&&(Sa(t.removed,{element:A.cloneNode()}),A.textContent=W)),Nt(ke.afterSanitizeElements,A,null),!1)},jn=function(A,W,v){if(Z[W]||qe&&(W==="id"||W==="name")&&(v in s||v in q))return!1;const D=k[W]||X.attributeCheck instanceof Function&&X.attributeCheck(W,A);if(!(oe&&!Z[W]&&Ft(se,W))){if(!(ue&&Ft(Se,W))){if(!D||Z[W]){if(!(ai(A)&&($.tagNameCheck instanceof RegExp&&Ft($.tagNameCheck,A)||$.tagNameCheck instanceof Function&&$.tagNameCheck(A))&&($.attributeNameCheck instanceof RegExp&&Ft($.attributeNameCheck,W)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(W,A))||W==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Ft($.tagNameCheck,v)||$.tagNameCheck instanceof Function&&$.tagNameCheck(v))))return!1}else if(!Ps[W]){if(!Ft(ye,Ta(v,de,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&A!=="script"&&Gu(v,"data:")===0&&pt[A])){if(!(le&&!Ft(V,Ta(v,de,"")))){if(v)return!1}}}}}}return!0},Br=$e({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ai=function(A){return!Br[xi(A)]&&Ft(ce,A)},rl=function(A){Nt(ke.beforeSanitizeAttributes,A,null);const W=A.attributes;if(!W||z(A))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:k,forceKeepAttr:void 0};let D=W.length;for(;D--;){const B=W[D],ae=B.name,Ne=B.namespaceURI,Ue=B.value,et=Ye(ae),Vt=Ue;let vt=ae==="value"?Vt:Iw(Vt);if(v.attrName=et,v.attrValue=vt,v.keepAttr=!0,v.forceKeepAttr=void 0,Nt(ke.uponSanitizeAttribute,A,v),vt=v.attrValue,ct&&(et==="id"||et==="name")&&Gu(vt,K)!==0&&(Ts(ae,A),vt=K+vt),fe&&Ft(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,vt)){Ts(ae,A);continue}if(et==="attributename"&&qu(vt,"href")){Ts(ae,A);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){Ts(ae,A);continue}if(!te&&Ft(/\/>/i,vt)){Ts(ae,A);continue}ne&&on([ie,he,F],id=>{vt=Ta(vt,id," ")});const li=Ye(A.nodeName);if(!jn(li,et,vt)){Ts(ae,A);continue}if(g&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!Ne)switch(u.getAttributeType(li,et)){case"TrustedHTML":{vt=P(vt);break}case"TrustedScriptURL":{vt=R(vt);break}}if(vt!==Vt)try{Ne?A.setAttributeNS(Ne,ae,vt):A.setAttribute(ae,vt),z(A)?Pt(A):ju(t.removed)}catch{Ts(ae,A)}}Nt(ke.afterSanitizeAttributes,A,null)},ya=function(A){let W=null;const v=ba(A);for(Nt(ke.beforeSanitizeShadowDOM,A,null);W=v.nextNode();)if(Nt(ke.uponSanitizeShadowNode,W,null),Cs(W),rl(W),pe(W.content)&&ya(W.content),(_?_(W):W.nodeType)===Ks.element){const B=x?x(W):W.shadowRoot;pe(B)&&(ii(B),ya(B))}Nt(ke.afterSanitizeShadowDOM,A,null)},ii=function(A){const W=[{node:A,shadow:null}];for(;W.length>0;){const v=W.pop();if(v.shadow){ya(v.shadow);continue}const D=v.node,ae=(_?_(D):D.nodeType)===Ks.element,Ne=E?E(D):D.childNodes;if(Ne)for(let Ue=Ne.length-1;Ue>=0;--Ue)W.push({node:Ne[Ue],shadow:null});if(ae){const Ue=S?S(D):null;if(typeof Ue=="string"&&Ye(Ue)==="template"){const et=D.content;pe(et)&&W.push({node:et,shadow:null})}}if(ae){const Ue=x?x(D):D.shadowRoot;pe(Ue)&&W.push({node:null,shadow:Ue},{node:Ue,shadow:null})}}};return t.sanitize=function(me){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,v=null,D=null,B=null;if($s=!me,$s&&(me=""),typeof me!="string"&&!_e(me)&&(me=Mw(me),typeof me!="string"))throw Kn("dirty is not a string, aborting");if(!t.isSupported)return me;Te||Ee(A),t.removed=[];const ae=Ce&&typeof me!="string"&&_e(me);if(ae){const et=S?S(me):me.nodeName;if(typeof et=="string"){const Vt=Ye(et);if(!ge[Vt]||ee[Vt])throw Kn("root node is forbidden and cannot be sanitized in-place")}if(z(me))throw Kn("root node is clobbered and cannot be sanitized in-place");try{ii(me)}catch(Vt){throw ma(me),Vt}}else if(_e(me))W=va(""),v=W.ownerDocument.importNode(me,!0),v.nodeType===Ks.element&&v.nodeName==="BODY"||v.nodeName==="HTML"?W=v:W.appendChild(v),ii(v);else{if(!Le&&!ne&&!ve&&me.indexOf("<")===-1)return g&&Be?P(me):me;if(W=va(me),!W)return Le?null:Be?w:""}W&&Oe&&Pt(W.firstChild);const Ne=ba(ae?me:W);try{for(;D=Ne.nextNode();)Cs(D),rl(D),pe(D.content)&&ya(D.content)}catch(et){throw ae&&ma(me),et}if(ae)return on(t.removed,et=>{et.element&&ni(et.element)}),ne&&Gs(me),me;if(Le){if(ne&&Gs(W),De)for(B=N.call(W.ownerDocument);W.firstChild;)B.appendChild(W.firstChild);else B=W;return(k.shadowroot||k.shadowrootmode)&&(B=we.call(n,B,!0)),B}let Ue=ve?W.outerHTML:W.innerHTML;return ve&&ge["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&Ft(Gw,W.ownerDocument.doctype.name)&&(Ue=" -`+Ue),ne&&on([ie,he,F],et=>{Ue=Ta(Ue,et," ")}),g&&Be?P(Ue):Ue},t.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ee(me),Te=!0},t.clearConfig=function(){gs=null,Te=!1,g=T,w=""},t.isValidAttribute=function(me,A,W){gs||Ee({});const v=Ye(me),D=Ye(A);return jn(v,D,W)},t.addHook=function(me,A){typeof A=="function"&&Sa(ke[me],A)},t.removeHook=function(me,A){if(A!==void 0){const W=Aw(ke[me],A);return W===-1?void 0:Rw(ke[me],W,1)[0]}return ju(ke[me])},t.removeHooks=function(me){ke[me]=[]},t.removeAllHooks=function(){ke=ef()},t}var tf=Lm();function Jc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ha=Jc();function Dm(e){ha=e}var Ii={exec:()=>null};function at(e,t=""){let s=typeof e=="string"?e:e.source;const n={replace:(a,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(ss.caret,"$1"),s=s.replace(a,l),n},getRegex:()=>new RegExp(s,t)};return n}var ss={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:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex: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")},Jw=/^(?:[ \t]*(?:\n|$))+/,Yw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ll=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yc=/(?:[*+-]|\d{1,9}[.)])/,Mm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pm=at(Mm).replace(/bull/g,Yc).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(),eS=at(Mm).replace(/bull/g,Yc).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(),Qc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tS=/^[^\n]+/,Xc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,sS=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nS=at(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yc).getRegex(),Fr="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",ed=/|$))/,aS=at("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ed).replace("tag",Fr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fm=at(Qc).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fr).getRegex(),iS=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fm).getRegex(),td={blockquote:iS,code:Yw,def:sS,fences:Qw,heading:Xw,hr:ll,html:aS,lheading:Pm,list:nS,newline:Jw,paragraph:Fm,table:Ii,text:tS},sf=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fr).getRegex(),lS={...td,lheading:eS,table:sf,paragraph:at(Qc).replace("hr",ll).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fr).getRegex()},rS={...td,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ed).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ii,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(Qc).replace("hr",ll).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Pm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},oS=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cS=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$m=/^( {2,}|\\)\n(?!\s*$)/,dS=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Hm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mS=at(Hm,"u").replace(/punct/g,$r).getRegex(),gS=at(Hm,"u").replace(/punct/g,Um).getRegex(),zm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vS=at(zm,"gu").replace(/notPunctSpace/g,Bm).replace(/punctSpace/g,sd).replace(/punct/g,$r).getRegex(),bS=at(zm,"gu").replace(/notPunctSpace/g,pS).replace(/punctSpace/g,fS).replace(/punct/g,Um).getRegex(),yS=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bm).replace(/punctSpace/g,sd).replace(/punct/g,$r).getRegex(),xS=at(/\\(punct)/,"gu").replace(/punct/g,$r).getRegex(),_S=at(/^<(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(),kS=at(ed).replace("(?:-->|$)","-->").getRegex(),wS=at("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",kS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,SS=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",lr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vm=at(/^!?\[(label)\]\[(ref)\]/).replace("label",lr).replace("ref",Xc).getRegex(),jm=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xc).getRegex(),TS=at("reflink|nolink(?!\\()","g").replace("reflink",Vm).replace("nolink",jm).getRegex(),nd={_backpedal:Ii,anyPunctuation:xS,autolink:_S,blockSkip:hS,br:$m,code:cS,del:Ii,emStrongLDelim:mS,emStrongRDelimAst:vS,emStrongRDelimUnd:yS,escape:oS,link:SS,nolink:jm,punctuation:uS,reflink:Vm,reflinkSearch:TS,tag:wS,text:dS,url:Ii},CS={...nd,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",lr).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lr).getRegex()},Ko={...nd,emStrongRDelimAst:bS,emStrongLDelim:gS,url:at(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},nf=e=>AS[e];function Js(e,t){if(t){if(ss.escapeTest.test(e))return e.replace(ss.escapeReplace,nf)}else if(ss.escapeTestNoEncode.test(e))return e.replace(ss.escapeReplaceNoEncode,nf);return e}function af(e){try{e=encodeURI(e).replace(ss.percentDecode,"%")}catch{return null}return e}function lf(e,t){var i;const s=e.replace(ss.findPipe,(l,r,o)=>{let c=!1,d=r;for(;--d>=0&&o[d]==="\\";)c=!c;return c?"|":" |"}),n=s.split(ss.splitPipe);let a=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function rf(e,t,s,n,a){const i=t.href,l=t.title||null,r=e[1].replace(a.other.outputLinkReplace,"$1");n.state.inLink=!0;const o={type:e[0].charAt(0)==="!"?"image":"link",raw:s,href:i,title:l,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,o}function IS(e,t,s){const n=e.match(s.other.indentCodeCompensation);if(n===null)return t;const a=n[1];return t.split(` + `,setup(){const e=h({}),t=h(!0),s=h(null),n=h([]),a=h(!1),i=h([]),l=h(!1),r=h([]),o=h(0),c=h(null),d=h({reload:!1,clearSessions:!1,stopLoops:!1});let u=0;const p=J(()=>{const R=e.value.uptime_seconds||0,V=Math.floor(R/86400),Q=Math.floor(R%86400/3600),U=Math.floor(R%3600/60),N=[];return V>0&&N.push(`${V}d`),Q>0&&N.push(`${Q}h`),(N.length===0||V===0&&Q===0)&&N.push(`${U}m`),N.join(" ")}),f=J(()=>{const R=e.value.uptime_seconds||0;return 125.66*(1-Math.min(R/86400,1))}),b=J(()=>{const R=e.value;return[{label:"Guilds",value:R.guild_count??0,icon:"home",iconColor:"text-blue-400"},{label:"Sessions",value:R.session_count??0,icon:"message",iconColor:"text-yellow-400"},{label:"Tools",value:R.tool_count??0,icon:"wrench",iconColor:"text-purple-400",sub:`${R.skill_count??0} skills`,subColor:"text-gray-500"},{label:"Loops",value:R.loop_count??0,icon:"rotate",iconColor:"text-green-400",color:R.loop_count>0?"text-green-400":"",highlight:R.loop_count>0},{label:"Agents",value:R.agent_running??0,icon:"bot",iconColor:"text-cyan-400",sub:R.agent_count>0?`${R.agent_count} total`:"",subColor:"text-gray-500",highlight:(R.agent_running??0)>0},{label:"Processes",value:R.process_running??0,icon:"sliders",iconColor:"text-orange-400",sub:R.process_count>0?`${R.process_count} total`:"",subColor:"text-gray-500",highlight:(R.process_running??0)>0},{label:"Schedules",value:R.schedule_count??0,icon:"clock",iconColor:"text-amber-400",sub:(R.schedule_failing>0?`${R.schedule_failing} failing`:"")+(R.schedule_failing>0&&R.schedule_paused>0?", ":"")+(R.schedule_paused>0?`${R.schedule_paused} paused`:"")||void 0,subColor:R.schedule_failing>0?"text-red-400":"text-yellow-400",color:R.schedule_failing>0?"text-red-400":"",highlight:R.schedule_failing>0},{label:"Users",value:R.user_count??0,icon:"users",iconColor:"text-indigo-400"},...c.value!==null?[{label:"Knowledge",value:c.value,icon:"book",iconColor:"text-teal-400",sub:"chunks",subColor:"text-gray-500"}]:[]]}),y=J(()=>{const R=e.value,V=[];return V.push({label:"Bot",status:R.status==="online"?"ok":"warn",detail:R.status==="online"?"Online":"Starting"}),(R.schedule_failing||0)>0?V.push({label:"Schedules",status:"error",detail:`${R.schedule_failing} failing`}):(R.schedule_count||0)>0&&V.push({label:"Schedules",status:"ok",detail:`${R.schedule_count} configured`}),(R.loop_count||0)>0&&V.push({label:"Loops",status:"ok",detail:`${R.loop_count} active`}),(R.agent_running||0)>0&&V.push({label:"Agents",status:"ok",detail:`${R.agent_running} running`}),(R.process_running||0)>0&&V.push({label:"Processes",status:"ok",detail:`${R.process_running} running`}),V});async function E(){try{e.value=await q.get("/api/status"),s.value=null}catch(R){s.value=R.message}finally{t.value=!1}}async function O(){a.value=!0;try{n.value=await q.get("/api/audit?limit=10"),o.value=0}catch{}a.value=!1}async function x(){l.value=!0;try{i.value=await q.get("/api/audit?error_only=1&limit=5")}catch{}l.value=!1}async function m(){try{const R=await q.get("/api/knowledge");c.value=(Array.isArray(R)?R:[]).reduce((V,Q)=>V+(Q.chunks||0),0)}catch{c.value=null}}async function _(){try{const R=await q.get("/api/agents");r.value=R.filter(V=>V.status==="running")}catch{}}async function S(){d.value={...d.value,reload:!0};try{await q.post("/api/reload"),Ee.success("Config reloaded")}catch(R){Ee.error(R.message)}d.value={...d.value,reload:!1}}async function g(){if(!await _s({title:"Clear all sessions",message:"Clear all conversation sessions? This cannot be undone.",confirmLabel:"Clear All",danger:!0}))return;d.value={...d.value,clearSessions:!0};const V=e.value.session_count;e.value={...e.value,session_count:0};try{const Q=await q.post("/api/sessions/clear-all");Ee.success(`Cleared ${Q.count} session${Q.count!==1?"s":""}`),await E()}catch(Q){e.value={...e.value,session_count:V},Ee.error(Q.message)}d.value={...d.value,clearSessions:!1}}async function w(){if(!await _s({title:"Stop all loops",message:"Stop all running loops?",confirmLabel:"Stop Loops",danger:!0}))return;d.value={...d.value,stopLoops:!0};const V=e.value.loop_count;e.value={...e.value,loop_count:0};try{const Q=await q.post("/api/loops/stop-all");Ee.success(Q.result),await E()}catch(Q){e.value={...e.value,loop_count:V},Ee.error(Q.message)}d.value={...d.value,stopLoops:!1}}function T(){t.value=!0,s.value=null,E(),O(),x(),_()}let C=null,M=null,H=null;function P(R){if(R.payload&&R.payload.tool_name){const V={...R.payload,_isNew:!0,_key:++u};n.value.unshift(V),n.value.length>10&&n.value.pop(),o.value++,V.error&&(i.value.unshift(V),i.value.length>5&&i.value.pop()),setTimeout(()=>{V._isNew=!1},1500),clearTimeout(H),H=setTimeout(()=>{o.value=0},1e4)}}return We(async()=>{await Promise.all([E(),O(),x(),_(),m()]),C=setInterval(E,15e3),M=setInterval(_,1e4),Ke.subscribe("events",P)}),xt(()=>{C&&clearInterval(C),M&&clearInterval(M),clearTimeout(H),Ke.unsubscribe("events",P)}),{status:e,loading:t,error:s,uptime:p,uptimeRingOffset:f,stats:b,healthIndicators:y,activity:n,activityLoading:a,newEventCount:o,errors:i,errorsLoading:l,agents:r,actionLoading:d,fetchActivity:O,fetchStatus:E,formatTime:hm,formatDuration:Xa,retry:T,reloadConfig:S,clearSessions:g,stopAllLoops:w}}};/*! @license DOMPurify 3.4.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.9/LICENSE */function zu(e,t){(t==null||t>e.length)&&(t=e.length);for(var s=0,n=Array(t);s2?n-2:0),i=2;i1?s-1:0),a=1;a"u"?null:Tt(BigInt.prototype.toString),Wu=typeof Symbol>"u"?null:Tt(Symbol.prototype.toString),ht=Tt(Object.prototype.hasOwnProperty),fi=Tt(Object.prototype.toString),Ft=Tt(RegExp.prototype.test),Kn=Lw(TypeError);function Tt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:xi;if(Vu&&Vu(e,null),!Xt(t))return e;let n=t.length;for(;n--;){let a=t[n];if(typeof a=="string"){const i=s(a);i!==a&&(Tw(t)||(t[n]=i),a=i)}e[a]=!0}return e}function Dw(e){for(let t=0;t/g),Hw=Ls(/\${[\w\W]*/g),zw=Ls(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vw=Ls(/^aria-[\-\w]+$/),Xu=Ls(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jw=Ls(/^(?:\w+script|data):/i),qw=Ls(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gw=Ls(/^html$/i),Kw=Ls(/^[a-z][.\w]*(-[.\w]+)+$/i),Ks={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ww=function(){return typeof window>"u"?null:window},Zw=function(t,s){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(n=s.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ep=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ww();const t=ve=>Lm(ve);if(t.version="3.4.9",t.removed=[],!e||!e.document||e.document.nodeType!==Ks.document||!e.Element)return t.isSupported=!1,t;let s=e.document;const n=s,a=n.currentScript;e.DocumentFragment;const i=e.HTMLTemplateElement,l=e.Node,r=e.Element,o=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,u=e.trustedTypes,p=r.prototype,f=Zs(p,"cloneNode"),b=Zs(p,"remove"),y=Zs(p,"nextSibling"),E=Zs(p,"childNodes"),O=Zs(p,"parentNode"),x=Zs(p,"shadowRoot"),m=Zs(p,"attributes"),_=l&&l.prototype?Zs(l.prototype,"nodeType"):null,S=l&&l.prototype?Zs(l.prototype,"nodeName"):null;if(typeof i=="function"){const ve=s.createElement("template");ve.content&&ve.content.ownerDocument&&(s=ve.content.ownerDocument)}let g,w="",T,C=!1,M=0;const H=function(){if(M>0)throw Kn('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},P=function(A){H(),M++;try{return g.createHTML(A)}finally{M--}},R=function(A){H(),M++;try{return g.createScriptURL(A)}finally{M--}},V=function(){return C||(T=Zw(u,a),C=!0),T},Q=s,U=Q.implementation,N=Q.createNodeIterator,I=Q.createDocumentFragment,Y=Q.getElementsByTagName,Se=n.importNode;let we=ep();t.isSupported=typeof Om=="function"&&typeof O=="function"&&U&&U.createHTMLDocument!==void 0;const re=Uw,he=Bw,se=Hw,me=zw,W=Vw,B=jw,ie=qw,le=Kw;let xe=Xu,ge=null;const Fe=Ue({},[...Zu,...co,...uo,...po,...Ju]);let k=null;const L=Ue({},[...Yu,...fo,...Qu,...Sl]);let F=Object.seal(Ra(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}})),ee=null,Z=null;const X=Object.seal(Ra(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ue=!0,de=!0,oe=!1,te=!0,ne=!1,pe=!0,be=!1,Te=!1,Oe=!1,Le=!1,De=!1,Be=!1,qe=!0,ct=!1;const G="user-content-";let _e=!0,Ce=!1,Re={},Ve=null;const Pe=Ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let ft=null;const ls=Ue({},["audio","video","img","source","image","track"]);let Ps=null;const nn=Ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ss="http://www.w3.org/1998/Math/MathML",Fs="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let Yt=Mt,$s=!1,Us=null;const An=Ue({},[Ss,Fs,Mt],oo);let Bs=Ue({},["mi","mo","mn","ms","mtext"]),zt=Ue({},["annotation-xml"]);const Vn=Ue({},["title","style","font","a","script"]);let Ct=null;const rs=["application/xhtml+xml","text/html"],os="text/html";let Ye=null,gs=null;const j=s.createElement("form"),ce=function(A){return A instanceof RegExp||A instanceof Function},Ae=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gs&&gs===A)return;(!A||typeof A!="object")&&(A={}),A=qt(A),Ct=rs.indexOf(A.PARSER_MEDIA_TYPE)===-1?os:A.PARSER_MEDIA_TYPE,Ye=Ct==="application/xhtml+xml"?oo:xi,ge=ht(A,"ALLOWED_TAGS")&&Xt(A.ALLOWED_TAGS)?Ue({},A.ALLOWED_TAGS,Ye):Fe,k=ht(A,"ALLOWED_ATTR")&&Xt(A.ALLOWED_ATTR)?Ue({},A.ALLOWED_ATTR,Ye):L,Us=ht(A,"ALLOWED_NAMESPACES")&&Xt(A.ALLOWED_NAMESPACES)?Ue({},A.ALLOWED_NAMESPACES,oo):An,Ps=ht(A,"ADD_URI_SAFE_ATTR")&&Xt(A.ADD_URI_SAFE_ATTR)?Ue(qt(nn),A.ADD_URI_SAFE_ATTR,Ye):nn,ft=ht(A,"ADD_DATA_URI_TAGS")&&Xt(A.ADD_DATA_URI_TAGS)?Ue(qt(ls),A.ADD_DATA_URI_TAGS,Ye):ls,Ve=ht(A,"FORBID_CONTENTS")&&Xt(A.FORBID_CONTENTS)?Ue({},A.FORBID_CONTENTS,Ye):Pe,ee=ht(A,"FORBID_TAGS")&&Xt(A.FORBID_TAGS)?Ue({},A.FORBID_TAGS,Ye):qt({}),Z=ht(A,"FORBID_ATTR")&&Xt(A.FORBID_ATTR)?Ue({},A.FORBID_ATTR,Ye):qt({}),Re=ht(A,"USE_PROFILES")?A.USE_PROFILES&&typeof A.USE_PROFILES=="object"?qt(A.USE_PROFILES):A.USE_PROFILES:!1,ue=A.ALLOW_ARIA_ATTR!==!1,de=A.ALLOW_DATA_ATTR!==!1,oe=A.ALLOW_UNKNOWN_PROTOCOLS||!1,te=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=A.SAFE_FOR_TEMPLATES||!1,pe=A.SAFE_FOR_XML!==!1,be=A.WHOLE_DOCUMENT||!1,Le=A.RETURN_DOM||!1,De=A.RETURN_DOM_FRAGMENT||!1,Be=A.RETURN_TRUSTED_TYPE||!1,Oe=A.FORCE_BODY||!1,qe=A.SANITIZE_DOM!==!1,ct=A.SANITIZE_NAMED_PROPS||!1,_e=A.KEEP_CONTENT!==!1,Ce=A.IN_PLACE||!1,xe=Pw(A.ALLOWED_URI_REGEXP)?A.ALLOWED_URI_REGEXP:Xu,Yt=typeof A.NAMESPACE=="string"?A.NAMESPACE:Mt,Bs=ht(A,"MATHML_TEXT_INTEGRATION_POINTS")&&A.MATHML_TEXT_INTEGRATION_POINTS&&typeof A.MATHML_TEXT_INTEGRATION_POINTS=="object"?qt(A.MATHML_TEXT_INTEGRATION_POINTS):Ue({},["mi","mo","mn","ms","mtext"]),zt=ht(A,"HTML_INTEGRATION_POINTS")&&A.HTML_INTEGRATION_POINTS&&typeof A.HTML_INTEGRATION_POINTS=="object"?qt(A.HTML_INTEGRATION_POINTS):Ue({},["annotation-xml"]);const K=ht(A,"CUSTOM_ELEMENT_HANDLING")&&A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING=="object"?qt(A.CUSTOM_ELEMENT_HANDLING):Ra(null);if(F=Ra(null),ht(K,"tagNameCheck")&&ce(K.tagNameCheck)&&(F.tagNameCheck=K.tagNameCheck),ht(K,"attributeNameCheck")&&ce(K.attributeNameCheck)&&(F.attributeNameCheck=K.attributeNameCheck),ht(K,"allowCustomizedBuiltInElements")&&typeof K.allowCustomizedBuiltInElements=="boolean"&&(F.allowCustomizedBuiltInElements=K.allowCustomizedBuiltInElements),ne&&(de=!1),De&&(Le=!0),Re&&(ge=Ue({},Ju),k=Ra(null),Re.html===!0&&(Ue(ge,Zu),Ue(k,Yu)),Re.svg===!0&&(Ue(ge,co),Ue(k,fo),Ue(k,Sl)),Re.svgFilters===!0&&(Ue(ge,uo),Ue(k,fo),Ue(k,Sl)),Re.mathMl===!0&&(Ue(ge,po),Ue(k,Qu),Ue(k,Sl))),X.tagCheck=null,X.attributeCheck=null,ht(A,"ADD_TAGS")&&(typeof A.ADD_TAGS=="function"?X.tagCheck=A.ADD_TAGS:Xt(A.ADD_TAGS)&&(ge===Fe&&(ge=qt(ge)),Ue(ge,A.ADD_TAGS,Ye))),ht(A,"ADD_ATTR")&&(typeof A.ADD_ATTR=="function"?X.attributeCheck=A.ADD_ATTR:Xt(A.ADD_ATTR)&&(k===L&&(k=qt(k)),Ue(k,A.ADD_ATTR,Ye))),ht(A,"ADD_URI_SAFE_ATTR")&&Xt(A.ADD_URI_SAFE_ATTR)&&Ue(Ps,A.ADD_URI_SAFE_ATTR,Ye),ht(A,"FORBID_CONTENTS")&&Xt(A.FORBID_CONTENTS)&&(Ve===Pe&&(Ve=qt(Ve)),Ue(Ve,A.FORBID_CONTENTS,Ye)),ht(A,"ADD_FORBID_CONTENTS")&&Xt(A.ADD_FORBID_CONTENTS)&&(Ve===Pe&&(Ve=qt(Ve)),Ue(Ve,A.ADD_FORBID_CONTENTS,Ye)),_e&&(ge["#text"]=!0),be&&Ue(ge,["html","head","body"]),ge.table&&(Ue(ge,["tbody"]),delete ee.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const v=g;g=A.TRUSTED_TYPES_POLICY;try{w=P("")}catch(D){throw g=v,D}}else A.TRUSTED_TYPES_POLICY===null?(g=void 0,w=""):(g===void 0&&(g=V()),g&&typeof w=="string"&&(w=P("")));(we.uponSanitizeElement.length>0||we.uponSanitizeAttribute.length>0)&&ge===Fe&&(ge=qt(ge)),we.uponSanitizeAttribute.length>0&&k===L&&(k=qt(k)),is&&is(A),gs=A},Ze=Ue({},[...co,...uo,...Fw]),lt=Ue({},[...po,...$w]),Ot=function(A){let K=O(A);(!K||!K.tagName)&&(K={namespaceURI:Yt,tagName:"template"});const v=xi(A.tagName),D=xi(K.tagName);return Us[A.namespaceURI]?A.namespaceURI===Fs?K.namespaceURI===Mt?v==="svg":K.namespaceURI===Ss?v==="svg"&&(D==="annotation-xml"||Bs[D]):!!Ze[v]:A.namespaceURI===Ss?K.namespaceURI===Mt?v==="math":K.namespaceURI===Fs?v==="math"&&zt[D]:!!lt[v]:A.namespaceURI===Mt?K.namespaceURI===Fs&&!zt[D]||K.namespaceURI===Ss&&!Bs[D]?!1:!lt[v]&&(Vn[v]||!Ze[v]):!!(Ct==="application/xhtml+xml"&&Us[A.namespaceURI]):!1},Pt=function(A){Sa(t.removed,{element:A});try{O(A).removeChild(A)}catch{if(b(A),!O(A))throw Kn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ma=function(A){const K=E?E(A):A.childNodes;if(K){const D=[];on(K,$=>{Sa(D,$)}),on(D,$=>{try{b($)}catch{}})}const v=m?m(A):null;if(v)for(let D=v.length-1;D>=0;--D){const $=v[D],ae=$&&$.name;if(typeof ae=="string")try{A.removeAttribute(ae)}catch{}}},Ts=function(A,K){try{Sa(t.removed,{attribute:K.getAttributeNode(A),from:K})}catch{Sa(t.removed,{attribute:null,from:K})}if(K.removeAttribute(A),A==="is")if(Le||De)try{Pt(K)}catch{}else try{K.setAttribute(A,"")}catch{}},ga=function(A){const K=m?m(A):A.attributes;if(K)for(let v=K.length-1;v>=0;--v){const D=K[v],$=D&&D.name;if(!(typeof $!="string"||k[Ye($)]))try{A.removeAttribute($)}catch{}}},ni=function(A){const K=[A];for(;K.length>0;){const v=K.pop();(_?_(v):v.nodeType)===Ks.element&&ga(v);const $=E?E(v):v.childNodes;if($)for(let ae=$.length-1;ae>=0;--ae)K.push($[ae])}},va=function(A){let K=null,v=null;if(Oe)A=""+A;else{const ae=qu(A,/^[\r\n\t ]+/);v=ae&&ae[0]}Ct==="application/xhtml+xml"&&Yt===Mt&&(A=''+A+"");const D=g?P(A):A;if(Yt===Mt)try{K=new d().parseFromString(D,Ct)}catch{}if(!K||!K.documentElement){K=U.createDocument(Yt,"template",null);try{K.documentElement.innerHTML=$s?w:D}catch{}}const $=K.body||K.documentElement;return A&&v&&$.insertBefore(s.createTextNode(v),$.childNodes[0]||null),Yt===Mt?Y.call(K,be?"html":"body")[0]:be?K.documentElement:$},ba=function(A){return N.call(A.ownerDocument||A,A,o.SHOW_ELEMENT|o.SHOW_COMMENT|o.SHOW_TEXT|o.SHOW_PROCESSING_INSTRUCTION|o.SHOW_CDATA_SECTION,null)},Gs=function(A){var K,v;A.normalize();const D=N.call(A.ownerDocument||A,A,o.SHOW_TEXT|o.SHOW_COMMENT|o.SHOW_CDATA_SECTION|o.SHOW_PROCESSING_INSTRUCTION,null);let $=D.nextNode();for(;$;){let Ne=$.data;on([re,he,se],He=>{Ne=Ta(Ne,He," ")}),$.data=Ne,$=D.nextNode()}const ae=(K=(v=A.querySelectorAll)===null||v===void 0?void 0:v.call(A,"template"))!==null&&K!==void 0?K:[];on(Array.from(ae),Ne=>{fe(Ne.content)&&Gs(Ne.content)})},z=function(A){const K=S?S(A):null;return typeof K!="string"||Ye(K)!=="form"?!1:typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||A.attributes!==m(A)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function"||A.nodeType!==_(A)||A.childNodes!==E(A)},fe=function(A){if(!_||typeof A!="object"||A===null)return!1;try{return _(A)===Ks.documentFragment}catch{return!1}},ke=function(A){if(!_||typeof A!="object"||A===null)return!1;try{return typeof _(A)=="number"}catch{return!1}};function Nt(ve,A,K){on(ve,v=>{v.call(t,A,K,gs)})}const Cs=function(A){let K=null;if(Nt(we.beforeSanitizeElements,A,null),z(A))return Pt(A),!0;const v=Ye(S?S(A):A.nodeName);if(Nt(we.uponSanitizeElement,A,{tagName:v,allowedTags:ge}),pe&&A.hasChildNodes()&&!ke(A.firstElementChild)&&Ft(/<[/\w!]/g,A.innerHTML)&&Ft(/<[/\w!]/g,A.textContent)||pe&&A.namespaceURI===Mt&&v==="style"&&ke(A.firstElementChild)||A.nodeType===Ks.progressingInstruction||pe&&A.nodeType===Ks.comment&&Ft(/<[/\w]/g,A.data))return Pt(A),!0;if(ee[v]||!(X.tagCheck instanceof Function&&X.tagCheck(v))&&!ge[v]){if(!ee[v]&&ai(v)&&(F.tagNameCheck instanceof RegExp&&Ft(F.tagNameCheck,v)||F.tagNameCheck instanceof Function&&F.tagNameCheck(v)))return!1;if(_e&&!Ve[v]){const $=O(A),ae=E(A);if(ae&&$){const Ne=ae.length;for(let He=Ne-1;He>=0;--He){const et=Ce?ae[He]:f(ae[He],!0);$.insertBefore(et,y(A))}}}return Pt(A),!0}return(_?_(A):A.nodeType)===Ks.element&&!Ot(A)||(v==="noscript"||v==="noembed"||v==="noframes")&&Ft(/<\/no(script|embed|frames)/i,A.innerHTML)?(Pt(A),!0):(ne&&A.nodeType===Ks.text&&(K=A.textContent,on([re,he,se],$=>{K=Ta(K,$," ")}),A.textContent!==K&&(Sa(t.removed,{element:A.cloneNode()}),A.textContent=K)),Nt(we.afterSanitizeElements,A,null),!1)},jn=function(A,K,v){if(Z[K]||qe&&(K==="id"||K==="name")&&(v in s||v in j))return!1;const D=k[K]||X.attributeCheck instanceof Function&&X.attributeCheck(K,A);if(!(de&&!Z[K]&&Ft(me,K))){if(!(ue&&Ft(W,K))){if(!D||Z[K]){if(!(ai(A)&&(F.tagNameCheck instanceof RegExp&&Ft(F.tagNameCheck,A)||F.tagNameCheck instanceof Function&&F.tagNameCheck(A))&&(F.attributeNameCheck instanceof RegExp&&Ft(F.attributeNameCheck,K)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(K,A))||K==="is"&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&Ft(F.tagNameCheck,v)||F.tagNameCheck instanceof Function&&F.tagNameCheck(v))))return!1}else if(!Ps[K]){if(!Ft(xe,Ta(v,ie,""))){if(!((K==="src"||K==="xlink:href"||K==="href")&&A!=="script"&&Gu(v,"data:")===0&&ft[A])){if(!(oe&&!Ft(B,Ta(v,ie,"")))){if(v)return!1}}}}}}return!0},Ur=Ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ai=function(A){return!Ur[xi(A)]&&Ft(le,A)},rl=function(A){Nt(we.beforeSanitizeAttributes,A,null);const K=A.attributes;if(!K||z(A))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:k,forceKeepAttr:void 0};let D=K.length;for(;D--;){const $=K[D],ae=$.name,Ne=$.namespaceURI,He=$.value,et=Ye(ae),Vt=He;let vt=ae==="value"?Vt:Iw(Vt);if(v.attrName=et,v.attrValue=vt,v.keepAttr=!0,v.forceKeepAttr=void 0,Nt(we.uponSanitizeAttribute,A,v),vt=v.attrValue,ct&&(et==="id"||et==="name")&&Gu(vt,G)!==0&&(Ts(ae,A),vt=G+vt),pe&&Ft(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,vt)){Ts(ae,A);continue}if(et==="attributename"&&qu(vt,"href")){Ts(ae,A);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){Ts(ae,A);continue}if(!te&&Ft(/\/>/i,vt)){Ts(ae,A);continue}ne&&on([re,he,se],id=>{vt=Ta(vt,id," ")});const li=Ye(A.nodeName);if(!jn(li,et,vt)){Ts(ae,A);continue}if(g&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!Ne)switch(u.getAttributeType(li,et)){case"TrustedHTML":{vt=P(vt);break}case"TrustedScriptURL":{vt=R(vt);break}}if(vt!==Vt)try{Ne?A.setAttributeNS(Ne,ae,vt):A.setAttribute(ae,vt),z(A)?Pt(A):ju(t.removed)}catch{Ts(ae,A)}}Nt(we.afterSanitizeAttributes,A,null)},ya=function(A){let K=null;const v=ba(A);for(Nt(we.beforeSanitizeShadowDOM,A,null);K=v.nextNode();)if(Nt(we.uponSanitizeShadowNode,K,null),Cs(K),rl(K),fe(K.content)&&ya(K.content),(_?_(K):K.nodeType)===Ks.element){const $=x?x(K):K.shadowRoot;fe($)&&(ii($),ya($))}Nt(we.afterSanitizeShadowDOM,A,null)},ii=function(A){const K=[{node:A,shadow:null}];for(;K.length>0;){const v=K.pop();if(v.shadow){ya(v.shadow);continue}const D=v.node,ae=(_?_(D):D.nodeType)===Ks.element,Ne=E?E(D):D.childNodes;if(Ne)for(let He=Ne.length-1;He>=0;--He)K.push({node:Ne[He],shadow:null});if(ae){const He=S?S(D):null;if(typeof He=="string"&&Ye(He)==="template"){const et=D.content;fe(et)&&K.push({node:et,shadow:null})}}if(ae){const He=x?x(D):D.shadowRoot;fe(He)&&K.push({node:null,shadow:He},{node:He,shadow:null})}}};return t.sanitize=function(ve){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=null,v=null,D=null,$=null;if($s=!ve,$s&&(ve=""),typeof ve!="string"&&!ke(ve)&&(ve=Mw(ve),typeof ve!="string"))throw Kn("dirty is not a string, aborting");if(!t.isSupported)return ve;Te||Ae(A),t.removed=[];const ae=Ce&&typeof ve!="string"&&ke(ve);if(ae){const et=S?S(ve):ve.nodeName;if(typeof et=="string"){const Vt=Ye(et);if(!ge[Vt]||ee[Vt])throw Kn("root node is forbidden and cannot be sanitized in-place")}if(z(ve))throw Kn("root node is clobbered and cannot be sanitized in-place");try{ii(ve)}catch(Vt){throw ma(ve),Vt}}else if(ke(ve))K=va(""),v=K.ownerDocument.importNode(ve,!0),v.nodeType===Ks.element&&v.nodeName==="BODY"||v.nodeName==="HTML"?K=v:K.appendChild(v),ii(v);else{if(!Le&&!ne&&!be&&ve.indexOf("<")===-1)return g&&Be?P(ve):ve;if(K=va(ve),!K)return Le?null:Be?w:""}K&&Oe&&Pt(K.firstChild);const Ne=ba(ae?ve:K);try{for(;D=Ne.nextNode();)Cs(D),rl(D),fe(D.content)&&ya(D.content)}catch(et){throw ae&&ma(ve),et}if(ae)return on(t.removed,et=>{et.element&&ni(et.element)}),ne&&Gs(ve),ve;if(Le){if(ne&&Gs(K),De)for($=I.call(K.ownerDocument);K.firstChild;)$.appendChild(K.firstChild);else $=K;return(k.shadowroot||k.shadowrootmode)&&($=Se.call(n,$,!0)),$}let He=be?K.outerHTML:K.innerHTML;return be&&ge["!doctype"]&&K.ownerDocument&&K.ownerDocument.doctype&&K.ownerDocument.doctype.name&&Ft(Gw,K.ownerDocument.doctype.name)&&(He=" +`+He),ne&&on([re,he,se],et=>{He=Ta(He,et," ")}),g&&Be?P(He):He},t.setConfig=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ae(ve),Te=!0},t.clearConfig=function(){gs=null,Te=!1,g=T,w=""},t.isValidAttribute=function(ve,A,K){gs||Ae({});const v=Ye(ve),D=Ye(A);return jn(v,D,K)},t.addHook=function(ve,A){typeof A=="function"&&Sa(we[ve],A)},t.removeHook=function(ve,A){if(A!==void 0){const K=Aw(we[ve],A);return K===-1?void 0:Rw(we[ve],K,1)[0]}return ju(we[ve])},t.removeHooks=function(ve){we[ve]=[]},t.removeAllHooks=function(){we=ep()},t}var tp=Lm();function Jc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ha=Jc();function Dm(e){ha=e}var Ii={exec:()=>null};function at(e,t=""){let s=typeof e=="string"?e:e.source;const n={replace:(a,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(ss.caret,"$1"),s=s.replace(a,l),n},getRegex:()=>new RegExp(s,t)};return n}var ss={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:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex: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")},Jw=/^(?:[ \t]*(?:\n|$))+/,Yw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ll=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yc=/(?:[*+-]|\d{1,9}[.)])/,Mm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pm=at(Mm).replace(/bull/g,Yc).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(),eS=at(Mm).replace(/bull/g,Yc).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(),Qc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tS=/^[^\n]+/,Xc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,sS=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nS=at(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yc).getRegex(),Fr="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",ed=/|$))/,aS=at("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ed).replace("tag",Fr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fm=at(Qc).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fr).getRegex(),iS=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fm).getRegex(),td={blockquote:iS,code:Yw,def:sS,fences:Qw,heading:Xw,hr:ll,html:aS,lheading:Pm,list:nS,newline:Jw,paragraph:Fm,table:Ii,text:tS},sp=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fr).getRegex(),lS={...td,lheading:eS,table:sp,paragraph:at(Qc).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",sp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fr).getRegex()},rS={...td,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ed).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ii,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(Qc).replace("hr",ll).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Pm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},oS=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cS=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$m=/^( {2,}|\\)\n(?!\s*$)/,dS=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Hm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mS=at(Hm,"u").replace(/punct/g,$r).getRegex(),gS=at(Hm,"u").replace(/punct/g,Bm).getRegex(),zm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vS=at(zm,"gu").replace(/notPunctSpace/g,Um).replace(/punctSpace/g,sd).replace(/punct/g,$r).getRegex(),bS=at(zm,"gu").replace(/notPunctSpace/g,fS).replace(/punctSpace/g,pS).replace(/punct/g,Bm).getRegex(),yS=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Um).replace(/punctSpace/g,sd).replace(/punct/g,$r).getRegex(),xS=at(/\\(punct)/,"gu").replace(/punct/g,$r).getRegex(),_S=at(/^<(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(),kS=at(ed).replace("(?:-->|$)","-->").getRegex(),wS=at("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",kS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,SS=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",lr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vm=at(/^!?\[(label)\]\[(ref)\]/).replace("label",lr).replace("ref",Xc).getRegex(),jm=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xc).getRegex(),TS=at("reflink|nolink(?!\\()","g").replace("reflink",Vm).replace("nolink",jm).getRegex(),nd={_backpedal:Ii,anyPunctuation:xS,autolink:_S,blockSkip:hS,br:$m,code:cS,del:Ii,emStrongLDelim:mS,emStrongRDelimAst:vS,emStrongRDelimUnd:yS,escape:oS,link:SS,nolink:jm,punctuation:uS,reflink:Vm,reflinkSearch:TS,tag:wS,text:dS,url:Ii},CS={...nd,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",lr).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lr).getRegex()},Ko={...nd,emStrongRDelimAst:bS,emStrongLDelim:gS,url:at(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},np=e=>AS[e];function Js(e,t){if(t){if(ss.escapeTest.test(e))return e.replace(ss.escapeReplace,np)}else if(ss.escapeTestNoEncode.test(e))return e.replace(ss.escapeReplaceNoEncode,np);return e}function ap(e){try{e=encodeURI(e).replace(ss.percentDecode,"%")}catch{return null}return e}function ip(e,t){var i;const s=e.replace(ss.findPipe,(l,r,o)=>{let c=!1,d=r;for(;--d>=0&&o[d]==="\\";)c=!c;return c?"|":" |"}),n=s.split(ss.splitPipe);let a=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0?-2:-1}function lp(e,t,s,n,a){const i=t.href,l=t.title||null,r=e[1].replace(a.other.outputLinkReplace,"$1");n.state.inLink=!0;const o={type:e[0].charAt(0)==="!"?"image":"link",raw:s,href:i,title:l,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,o}function IS(e,t,s){const n=e.match(s.other.indentCodeCompensation);if(n===null)return t;const a=n[1];return t.split(` `).map(i=>{const l=i.match(s.other.beginningSpace);if(l===null)return i;const[r]=l;return r.length>=a.length?i.slice(a.length):i}).join(` `)}var rr=class{constructor(e){rt(this,"options");rt(this,"rules");rt(this,"lexer");this.options=e||ha}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:mi(s,` `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],n=IS(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){const n=mi(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(s=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:mi(t[0],` @@ -5728,31 +5751,31 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),d=c.replace(this.rules.other.blockquoteSetextReplace,` $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n} ${c}`:c,a=a?`${a} -${d}`:d;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=u,s.length===0)break;const f=i.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){const p=f,b=p.raw+` +${d}`:d;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=u,s.length===0)break;const p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const f=p,b=f.raw+` `+s.join(` -`),y=this.blockquote(b);i[i.length-1]=y,n=n.substring(0,n.length-p.raw.length)+y.raw,a=a.substring(0,a.length-p.text.length)+y.text;break}else if((f==null?void 0:f.type)==="list"){const p=f,b=p.raw+` +`),y=this.blockquote(b);i[i.length-1]=y,n=n.substring(0,n.length-f.raw.length)+y.raw,a=a.substring(0,a.length-f.text.length)+y.text;break}else if((p==null?void 0:p.type)==="list"){const f=p,b=f.raw+` `+s.join(` -`),y=this.list(b);i[i.length-1]=y,n=n.substring(0,n.length-f.raw.length)+y.raw,a=a.substring(0,a.length-p.raw.length)+y.raw,s=b.substring(i.at(-1).raw.length).split(` +`),y=this.list(b);i[i.length-1]=y,n=n.substring(0,n.length-p.raw.length)+y.raw,a=a.substring(0,a.length-f.raw.length)+y.raw,s=b.substring(i.at(-1).raw.length).split(` `);continue}}return{type:"blockquote",raw:n,tokens:i,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim();const n=s.length>1,a={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");const i=this.rules.other.listItemRegex(s);let l=!1;for(;e;){let o=!1,c="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let u=t[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,I=>" ".repeat(3*I.length)),f=e.split(` -`,1)[0],p=!u.trim(),b=0;if(this.options.pedantic?(b=2,d=u.trimStart()):p?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,d=u.slice(b),b+=t[1].length),p&&this.rules.other.blankLine.test(f)&&(c+=f+` -`,e=e.substring(f.length+1),o=!0),!o){const I=this.rules.other.nextBulletRegex(b),x=this.rules.other.hrRegex(b),m=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),S=this.rules.other.htmlBeginRegex(b);for(;e;){const g=e.split(` -`,1)[0];let w;if(f=g,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),w=f):w=f.replace(this.rules.other.tabCharGlobal," "),m.test(f)||_.test(f)||S.test(f)||I.test(f)||x.test(f))break;if(w.search(this.rules.other.nonSpaceChar)>=b||!f.trim())d+=` -`+w.slice(b);else{if(p||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(u)||_.test(u)||x.test(u))break;d+=` -`+f}!p&&!f.trim()&&(p=!0),c+=g+` -`,e=e.substring(g.length+1),u=w.slice(b)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let y=null,E;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(E=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:c,task:!!y,checked:E,loose:!1,text:d,tokens:[]}),a.raw+=c}const r=a.items.at(-1);if(r)r.raw=r.raw.trimEnd(),r.text=r.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let o=0;ou.type==="space"),d=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));a.loose=d}if(a.loose)for(let o=0;o({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[c]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const i=mi(s.slice(0,-1),"\\");if((s.length-i.length)%2===0)return}else{const i=RS(t[2],"()");if(i===-2)return;if(i>-1){const r=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let n=t[2],a="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],a=i[3])}else a=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),rf(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[n.toLowerCase()];if(!a){const i=s[0].charAt(0);return{type:"text",raw:i,text:i}}return rf(s,a,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const i=[...n[0]].length-1;let l,r,o=i,c=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(n=d.exec(t))!=null;){if(l=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!l)continue;if(r=[...l].length,n[3]||n[4]){o+=r;continue}else if((n[5]||n[6])&&i%3&&!((i+r)%3)){c+=r;continue}if(o-=r,o>0)continue;r=Math.min(r,r+o+c);const u=[...n[0]][0].length,f=e.slice(0,i+n.index+u+r);if(Math.min(i,r)%2){const b=f.slice(1,-1);return{type:"em",raw:f,text:b,tokens:this.lexer.inlineTokens(b)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,n;return t[2]==="@"?(s=t[1],n="mailto:"+s):(s=t[1],n=s),{type:"link",raw:t[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let n,a;if(t[2]==="@")n=t[0],a="mailto:"+n;else{let i;do i=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(i!==t[0]);n=t[0],t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}},gn=class Wo{constructor(t){rt(this,"tokens");rt(this,"options");rt(this,"state");rt(this,"tokenizer");rt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ha,this.options.tokenizer=this.options.tokenizer||new rr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:ss,block:Tl.normal,inline:hi.normal};this.options.pedantic?(s.block=Tl.pedantic,s.inline=hi.pedantic):this.options.gfm&&(s.block=Tl.gfm,this.options.breaks?s.inline=hi.breaks:s.inline=hi.gfm),this.tokenizer.rules=s}static get rules(){return{block:Tl,inline:hi}}static lex(t,s){return new Wo(s).lex(t)}static lexInline(t,s){return new Wo(s).inlineTokens(t)}lex(t){t=t.replace(ss.carriageReturn,` +`,1)[0].replace(this.rules.other.listReplaceTabs,O=>" ".repeat(3*O.length)),p=e.split(` +`,1)[0],f=!u.trim(),b=0;if(this.options.pedantic?(b=2,d=u.trimStart()):f?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,d=u.slice(b),b+=t[1].length),f&&this.rules.other.blankLine.test(p)&&(c+=p+` +`,e=e.substring(p.length+1),o=!0),!o){const O=this.rules.other.nextBulletRegex(b),x=this.rules.other.hrRegex(b),m=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),S=this.rules.other.htmlBeginRegex(b);for(;e;){const g=e.split(` +`,1)[0];let w;if(p=g,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),w=p):w=p.replace(this.rules.other.tabCharGlobal," "),m.test(p)||_.test(p)||S.test(p)||O.test(p)||x.test(p))break;if(w.search(this.rules.other.nonSpaceChar)>=b||!p.trim())d+=` +`+w.slice(b);else{if(f||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(u)||_.test(u)||x.test(u))break;d+=` +`+p}!f&&!p.trim()&&(f=!0),c+=g+` +`,e=e.substring(g.length+1),u=w.slice(b)}}a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let y=null,E;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(E=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:c,task:!!y,checked:E,loose:!1,text:d,tokens:[]}),a.raw+=c}const r=a.items.at(-1);if(r)r.raw=r.raw.trimEnd(),r.text=r.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let o=0;ou.type==="space"),d=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));a.loose=d}if(a.loose)for(let o=0;o({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[c]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const i=mi(s.slice(0,-1),"\\");if((s.length-i.length)%2===0)return}else{const i=RS(t[2],"()");if(i===-2)return;if(i>-1){const r=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let n=t[2],a="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],a=i[3])}else a=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),lp(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[n.toLowerCase()];if(!a){const i=s[0].charAt(0);return{type:"text",raw:i,text:i}}return lp(s,a,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const i=[...n[0]].length-1;let l,r,o=i,c=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(n=d.exec(t))!=null;){if(l=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!l)continue;if(r=[...l].length,n[3]||n[4]){o+=r;continue}else if((n[5]||n[6])&&i%3&&!((i+r)%3)){c+=r;continue}if(o-=r,o>0)continue;r=Math.min(r,r+o+c);const u=[...n[0]][0].length,p=e.slice(0,i+n.index+u+r);if(Math.min(i,r)%2){const b=p.slice(1,-1);return{type:"em",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}const f=p.slice(2,-2);return{type:"strong",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,n;return t[2]==="@"?(s=t[1],n="mailto:"+s):(s=t[1],n=s),{type:"link",raw:t[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let n,a;if(t[2]==="@")n=t[0],a="mailto:"+n;else{let i;do i=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(i!==t[0]);n=t[0],t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}},gn=class Wo{constructor(t){rt(this,"tokens");rt(this,"options");rt(this,"state");rt(this,"tokenizer");rt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ha,this.options.tokenizer=this.options.tokenizer||new rr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:ss,block:Tl.normal,inline:hi.normal};this.options.pedantic?(s.block=Tl.pedantic,s.inline=hi.pedantic):this.options.gfm&&(s.block=Tl.gfm,this.options.breaks?s.inline=hi.breaks:s.inline=hi.gfm),this.tokenizer.rules=s}static get rules(){return{block:Tl,inline:hi}}static lex(t,s){return new Wo(s).lex(t)}static lexInline(t,s){return new Wo(s).inlineTokens(t)}lex(t){t=t.replace(ss.carriageReturn,` `),this.blockTokens(t,this.tokens);for(let s=0;s(r=c.call({lexer:this},t,s))?(t=t.substring(r.raw.length),s.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);const c=s.at(-1);r.raw.length===1&&c!==void 0?c.raw+=` `:s.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);const c=s.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=` `+r.raw,c.text+=` `+r.text,this.inlineQueue.at(-1).src=c.text):s.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);const c=s.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=` `+r.raw,c.text+=` -`+r.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),s.push(r);continue}let o=t;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0;const d=t.slice(1);let u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){const c=s.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=` +`+r.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),s.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),s.push(r);continue}let o=t;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0;const d=t.slice(1);let u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},d),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){const c=s.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=` `+r.raw,c.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(r),n=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);const c=s.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=` `+r.raw,c.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}inlineTokens(t,s=[]){var r,o,c;let n=t,a=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,a.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,l="";for(;t;){i||(l=""),i=!1;let d;if((o=(r=this.options.extensions)==null?void 0:r.inline)!=null&&o.some(f=>(d=f.call({lexer:this},t,s))?(t=t.substring(d.raw.length),s.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const f=s.at(-1);d.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=d.raw,f.text+=d.text):s.push(d);continue}if(d=this.tokenizer.emStrong(t,n,l)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),s.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),s.push(d);continue}let u=t;if((c=this.options.extensions)!=null&&c.startInline){let f=1/0;const p=t.slice(1);let b;this.options.extensions.startInline.forEach(y=>{b=y.call({lexer:this},p),typeof b=="number"&&b>=0&&(f=Math.min(f,b))}),f<1/0&&f>=0&&(u=t.substring(0,f+1))}if(d=this.tokenizer.inlineText(u)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),i=!0;const f=s.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=d.raw,f.text+=d.text):s.push(d);continue}if(t){const f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return s}},or=class{constructor(e){rt(this,"options");rt(this,"parser");this.options=e||ha}space(e){return""}code({text:e,lang:t,escaped:s}){var i;const n=(i=(t||"").match(ss.notSpaceStart))==null?void 0:i[0],a=e.replace(ss.endingNewline,"")+` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}inlineTokens(t,s=[]){var r,o,c;let n=t,a=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,a.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,l="";for(;t;){i||(l=""),i=!1;let d;if((o=(r=this.options.extensions)==null?void 0:r.inline)!=null&&o.some(p=>(d=p.call({lexer:this},t,s))?(t=t.substring(d.raw.length),s.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const p=s.at(-1);d.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(d=this.tokenizer.emStrong(t,n,l)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),s.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),s.push(d);continue}let u=t;if((c=this.options.extensions)!=null&&c.startInline){let p=1/0;const f=t.slice(1);let b;this.options.extensions.startInline.forEach(y=>{b=y.call({lexer:this},f),typeof b=="number"&&b>=0&&(p=Math.min(p,b))}),p<1/0&&p>=0&&(u=t.substring(0,p+1))}if(d=this.tokenizer.inlineText(u)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),i=!0;const p=s.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return s}},or=class{constructor(e){rt(this,"options");rt(this,"parser");this.options=e||ha}space(e){return""}code({text:e,lang:t,escaped:s}){var i;const n=(i=(t||"").match(ss.notSpaceStart))==null?void 0:i[0],a=e.replace(ss.endingNewline,"")+` `;return n?'
'+(s?a:Js(a,!0))+`
`:"
"+(s?a:Js(a,!0))+`
`}blockquote({tokens:e}){return`
@@ -5770,9 +5793,9 @@ ${this.parser.parse(e)}
`}tablerow({text:e}){return` ${e} `}tablecell(e){const t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Js(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:s}){const n=this.parser.parseInline(s),a=af(e);if(a===null)return n;e=a;let i='
",i}image({href:e,title:t,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));const a=af(e);if(a===null)return Js(s);e=a;let i=`${s}${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Js(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:s}){const n=this.parser.parseInline(s),a=ap(e);if(a===null)return n;e=a;let i='
",i}image({href:e,title:t,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));const a=ap(e);if(a===null)return Js(s);e=a;let i=`${s}{const o=l[r].flat(1/0);s=s.concat(this.walkTokens(o,t))}):l.tokens&&(s=s.concat(this.walkTokens(l.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const i=t.renderers[a.name];i?t.renderers[a.name]=function(...l){let r=a.renderer.apply(this,l);return r===!1&&(r=i.apply(this,l)),r}:t.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'");const i=t[a.level];i?i.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),n.extensions=t),s.renderer){const a=this.defaults.renderer||new or(this.defaults);for(const i in s.renderer){if(!(i in a))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const l=i,r=s.renderer[l],o=a[l];a[l]=(...c)=>{let d=r.apply(a,c);return d===!1&&(d=o.apply(a,c)),d||""}}n.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new rr(this.defaults);for(const i in s.tokenizer){if(!(i in a))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const l=i,r=s.tokenizer[l],o=a[l];a[l]=(...c)=>{let d=r.apply(a,c);return d===!1&&(d=o.apply(a,c)),d}}n.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Nl;for(const i in s.hooks){if(!(i in a))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const l=i,r=s.hooks[l],o=a[l];Nl.passThroughHooks.has(i)?a[l]=c=>{if(this.defaults.async)return Promise.resolve(r.call(a,c)).then(u=>o.call(a,u));const d=r.call(a,c);return o.call(a,d)}:a[l]=(...c)=>{let d=r.apply(a,c);return d===!1&&(d=o.apply(a,c)),d}}n.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(l){let r=[];return r.push(i.call(this,l)),a&&(r=r.concat(a.call(this,l))),r}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return gn.lex(e,t??this.defaults)}parser(e,t){return vn.parse(e,t??this.defaults)}parseMarkdown(e){return(s,n)=>{const a={...n},i={...this.defaults,...a},l=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&a.async===!1)return l(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 s>"u"||s===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const r=i.hooks?i.hooks.provideLexer():e?gn.lex:gn.lexInline,o=i.hooks?i.hooks.provideParser():e?vn.parse:vn.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(s):s).then(c=>r(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>o(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(l);try{i.hooks&&(s=i.hooks.preprocess(s));let c=r(s,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let d=o(c,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(e,t){return s=>{if(s.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const n="

An error occurred:

"+Js(s.message+"",!0)+"
";return t?Promise.resolve(n):n}if(t)return Promise.reject(s);throw s}}},oa=new OS;function st(e,t){return oa.parse(e,t)}st.options=st.setOptions=function(e){return oa.setOptions(e),st.defaults=oa.defaults,Dm(st.defaults),st};st.getDefaults=Jc;st.defaults=ha;st.use=function(...e){return oa.use(...e),st.defaults=oa.defaults,Dm(st.defaults),st};st.walkTokens=function(e,t){return oa.walkTokens(e,t)};st.parseInline=oa.parseInline;st.Parser=vn;st.parser=vn.parse;st.Renderer=or;st.TextRenderer=ad;st.Lexer=gn;st.lexer=gn.lex;st.Tokenizer=rr;st.Hooks=Nl;st.parse=st;st.options;st.setOptions;st.use;st.walkTokens;st.parseInline;vn.parse;gn.lex;const NS={breaks:!0,gfm:!0};function of(e){if(!e)return"";try{if(typeof st<"u"&&st.parse){const t=st.parse(e,NS);return typeof tf<"u"?tf.sanitize(t):t}}catch{}return e.replace(/&/g,"&").replace(//g,">").replace(/\n/g,"
")}function LS(e){const t=new Date(e),s=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0");return`${s}:${n}`}const DS={run_command:"terminal",ssh_command:"terminal",run_script:"terminal",read_file:"file",write_file:"edit",list_directory:"folder",search_knowledge:"search",ingest_document:"book",generate_image:"image",analyze_image:"eye",analyze_pdf:"file",browser_screenshot:"globe",manage_process:"sliders"};function MS(e){return DS[e]||"wrench"}const PS=/https?:\/\/\S+\.(?:png|jpg|jpeg|gif|webp|svg)(?:\?\S*)?/gi;function cf(e){if(!e)return[];const t=e.match(PS);return t?[...new Set(t)]:[]}const FS={template:` +Please report this to https://github.com/markedjs/marked.`,e){const n="

An error occurred:

"+Js(s.message+"",!0)+"
";return t?Promise.resolve(n):n}if(t)return Promise.reject(s);throw s}}},oa=new OS;function st(e,t){return oa.parse(e,t)}st.options=st.setOptions=function(e){return oa.setOptions(e),st.defaults=oa.defaults,Dm(st.defaults),st};st.getDefaults=Jc;st.defaults=ha;st.use=function(...e){return oa.use(...e),st.defaults=oa.defaults,Dm(st.defaults),st};st.walkTokens=function(e,t){return oa.walkTokens(e,t)};st.parseInline=oa.parseInline;st.Parser=vn;st.parser=vn.parse;st.Renderer=or;st.TextRenderer=ad;st.Lexer=gn;st.lexer=gn.lex;st.Tokenizer=rr;st.Hooks=Nl;st.parse=st;st.options;st.setOptions;st.use;st.walkTokens;st.parseInline;vn.parse;gn.lex;const NS={breaks:!0,gfm:!0};function rp(e){if(!e)return"";try{if(typeof st<"u"&&st.parse){const t=st.parse(e,NS);return typeof tp<"u"?tp.sanitize(t):t}}catch{}return e.replace(/&/g,"&").replace(//g,">").replace(/\n/g,"
")}function LS(e){const t=new Date(e),s=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0");return`${s}:${n}`}const DS={run_command:"terminal",ssh_command:"terminal",run_script:"terminal",read_file:"file",write_file:"edit",list_directory:"folder",search_knowledge:"search",ingest_document:"book",generate_image:"image",analyze_image:"eye",analyze_pdf:"file",browser_screenshot:"globe",manage_process:"sliders"};function MS(e){return DS[e]||"wrench"}const PS=/https?:\/\/\S+\.(?:png|jpg|jpeg|gif|webp|svg)(?:\?\S*)?/gi;function op(e){if(!e)return[];const t=e.match(PS);return t?[...new Set(t)]:[]}const FS={template:`
@@ -5935,7 +5958,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const n="

An err

- `,setup(){const e=h([]),t=h(""),s=h(!1),n=h(null),a=h(null),i=h(0),l=h("");let r=null,o=0;const c=["Check system health","List running services","Show disk usage","What can you do?"],d=J(()=>t.value.trim().length>0&&!s.value),u=h(Ke.state||"disconnected");let f=null,p=null;const b=J(()=>{const U=u.value;return U==="connected"?"Connected":U==="reconnecting"?"Reconnecting…":U==="connecting"?"Connecting…":"REST fallback"}),y=["Watching across all realms...","Processing...","Consulting the bifrost...","Observing..."],E=J(()=>{const U=Math.floor(i.value/4)%y.length,O=i.value;return O>3?`${y[U]} (${O}s)`:y[0]});function I(){Rt(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}function x(){if(!a.value)return;const U=a.value;U.style.height="auto",U.style.height=Math.min(U.scrollHeight,120)+"px"}function m(U,O,N={}){const Y={id:++o,role:U,content:O,timestamp:Date.now(),html:U==="bot"?of(O):"",tools_used:N.tools_used||[],is_error:N.is_error||!1,images:U==="bot"?cf(O):[],files:N.files||[],_showTools:!1};return e.value.push(Y),I(),U==="bot"&&Rt(()=>_()),Y}function _(){if(!n.value)return;n.value.querySelectorAll(".chat-markdown pre:not([data-copy])").forEach(O=>{O.setAttribute("data-copy","true"),O.style.position="relative";const N=document.createElement("button");N.className="chat-code-copy",N.textContent="Copy",N.addEventListener("click",()=>{const Y=O.querySelector("code"),we=Y?Y.textContent:O.textContent;navigator.clipboard.writeText(we).then(()=>{N.textContent="Copied!",setTimeout(()=>{N.textContent="Copy"},1500)}).catch(()=>{})}),O.appendChild(N)})}function S(U){if(U===0)return!0;const O=e.value[U-1],N=e.value[U],Y=new Date(O.timestamp).toDateString(),we=new Date(N.timestamp).toDateString();return Y!==we}function g(U){const O=new Date(U),N=new Date;if(O.toDateString()===N.toDateString())return"Today";const Y=new Date(N);return Y.setDate(Y.getDate()-1),O.toDateString()===Y.toDateString()?"Yesterday":O.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function w(U){t.value=U,Rt(()=>j())}function T(U){window.open(U,"_blank","noopener")}function C(U){U.target.style.display="none"}function M(){i.value=0,r=setInterval(()=>{i.value++},1e3)}function H(){r&&(clearInterval(r),r=null),i.value=0}function P(U){s.value&&(s.value=!1,H(),U.type==="chat_response"?m("bot",U.content,{tools_used:U.tools_used||[],is_error:U.is_error||!1,files:U.files||[]}):U.type==="chat_error"&&m("bot",U.error||"Unknown error",{is_error:!0}),Rt(()=>{var O;return(O=a.value)==null?void 0:O.focus()}))}async function R(U){try{const O=await G.post("/api/chat",{content:U,channel_id:l.value});m("bot",O.response,{tools_used:O.tools_used||[],is_error:O.is_error||!1,files:O.files||[]})}catch(O){m("bot",O.message||"Failed to send message",{is_error:!0})}}async function j(){const U=t.value.trim();if(!U||s.value)return;m("user",U),t.value="",s.value=!0,M(),a.value&&(a.value.style.height="auto"),Ke.connected&&Ke.sendChat(U,{channelId:l.value})||(await R(U),s.value=!1,H()),Rt(()=>{var N;return(N=a.value)==null?void 0:N.focus()})}async function Q(){try{if(!l.value){const O=await G.get("/api/auth/session");l.value=O.channel_id||O.user_id||"web-user"}const U=await G.get("/api/sessions/"+encodeURIComponent(l.value));if(U&&U.messages&&U.messages.length>0){for(const O of U.messages){const N=O.role==="user"?"user":"bot";let Y=O.content||"";if(N==="user"){const ke=Y.match(/^\[.*?\]:\s*/);ke&&(Y=Y.slice(ke[0].length))}if(!Y.trim())continue;const we={id:++o,role:N,content:Y,timestamp:O.timestamp?O.timestamp*1e3:Date.now(),html:N==="bot"?of(Y):"",tools_used:[],is_error:!1,images:N==="bot"?cf(Y):[],files:[],_showTools:!1};e.value.push(we)}Rt(()=>{I(),_()})}}catch{}}return We(()=>{Ke.subscribe("chat",P),u.value=Ke.state||"disconnected",f=Ke.onStateChange,p=(U,O)=>{u.value=U,f&&f(U,O)},Ke.onStateChange=p,Q(),Rt(()=>{var U;return(U=a.value)==null?void 0:U.focus()})}),xt(()=>{Ke.unsubscribe("chat",P),Ke.onStateChange===p&&(Ke.onStateChange=f),H()}),{messages:e,input:t,sending:s,messagesEl:n,inputEl:a,canSend:d,wsStatus:b,typingText:E,suggestions:c,send:j,autoResize:x,formatTime:LS,formatDate:g,showDateSeparator:S,useSuggestion:w,openImage:T,onImageError:C,getToolIcon:MS}}},$S={setup(){const e=h("odin"),t=h(""),s=h(""),n=h(""),a=h({}),i=h([]),l=h([]),r=h(!1),o=h(!1),c=h(null),d=h(!0),u=h(""),f=h(!1),p=h(!1),b=J(()=>e.value==="custom"),y=J(()=>[...i.value,...l.value]),E=J(()=>l.value.includes(e.value)),I=J(()=>{var T;return b.value?t.value||"Odin":((T=a.value[e.value])==null?void 0:T.name)||e.value}),x=J(()=>{var T;return b.value?s.value||"(empty — will use Odin default)":((T=a.value[e.value])==null?void 0:T.identity)||""}),m=J(()=>{var T;return b.value?n.value||"(empty — will use Odin default)":((T=a.value[e.value])==null?void 0:T.voice)||""});async function _(){d.value=!0;try{const T=await G.get("/api/personality");e.value=T.preset||"odin",t.value=T.custom_name||"",s.value=T.custom_identity||"",n.value=T.custom_voice||"",a.value=T.presets||{},i.value=T.builtin_presets||[],l.value=T.user_presets||[]}catch(T){c.value=T.message}finally{d.value=!1}}async function S(){r.value=!0,c.value=null,o.value=!1;try{await G.put("/api/personality",{preset:e.value,custom_name:t.value,custom_identity:s.value,custom_voice:n.value}),o.value=!0,setTimeout(()=>o.value=!1,3e3)}catch(T){c.value=T.message}finally{r.value=!1}}async function g(){const T=u.value.trim();if(T){p.value=!0,c.value=null;try{await G.post("/api/personality/presets",{name:T,display_name:I.value,identity:x.value,voice:m.value}),f.value=!1,u.value="",await _(),e.value=T.toLowerCase().replace(/ /g,"_")}catch(C){c.value=C.message}finally{p.value=!1}}}async function w(){if(await _s({title:"Delete preset",message:`Delete preset "${e.value}"? This cannot be undone.`,confirmLabel:"Delete",danger:!0})){c.value=null;try{await G.del(`/api/personality/presets/${encodeURIComponent(e.value)}`),await _(),e.value="odin"}catch(C){c.value=C.message}}}return We(_),{preset:e,customName:t,customIdentity:s,customVoice:n,presets:a,presetNames:y,isCustom:b,isUserPreset:E,previewName:I,previewIdentity:x,previewVoice:m,saving:r,saved:o,error:c,loading:d,save:S,showSavePreset:f,newPresetName:u,savingPreset:p,saveAsPreset:g,deletePreset:w,builtinPresets:i,userPresets:l}},template:` + `,setup(){const e=h([]),t=h(""),s=h(!1),n=h(null),a=h(null),i=h(0),l=h("");let r=null,o=0;const c=["Check system health","List running services","Show disk usage","What can you do?"],d=J(()=>t.value.trim().length>0&&!s.value),u=h(Ke.state||"disconnected");let p=null,f=null;const b=J(()=>{const U=u.value;return U==="connected"?"Connected":U==="reconnecting"?"Reconnecting…":U==="connecting"?"Connecting…":"REST fallback"}),y=["Watching across all realms...","Processing...","Consulting the bifrost...","Observing..."],E=J(()=>{const U=Math.floor(i.value/4)%y.length,N=i.value;return N>3?`${y[U]} (${N}s)`:y[0]});function O(){Rt(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}function x(){if(!a.value)return;const U=a.value;U.style.height="auto",U.style.height=Math.min(U.scrollHeight,120)+"px"}function m(U,N,I={}){const Y={id:++o,role:U,content:N,timestamp:Date.now(),html:U==="bot"?rp(N):"",tools_used:I.tools_used||[],is_error:I.is_error||!1,images:U==="bot"?op(N):[],files:I.files||[],_showTools:!1};return e.value.push(Y),O(),U==="bot"&&Rt(()=>_()),Y}function _(){if(!n.value)return;n.value.querySelectorAll(".chat-markdown pre:not([data-copy])").forEach(N=>{N.setAttribute("data-copy","true"),N.style.position="relative";const I=document.createElement("button");I.className="chat-code-copy",I.textContent="Copy",I.addEventListener("click",()=>{const Y=N.querySelector("code"),Se=Y?Y.textContent:N.textContent;navigator.clipboard.writeText(Se).then(()=>{I.textContent="Copied!",setTimeout(()=>{I.textContent="Copy"},1500)}).catch(()=>{})}),N.appendChild(I)})}function S(U){if(U===0)return!0;const N=e.value[U-1],I=e.value[U],Y=new Date(N.timestamp).toDateString(),Se=new Date(I.timestamp).toDateString();return Y!==Se}function g(U){const N=new Date(U),I=new Date;if(N.toDateString()===I.toDateString())return"Today";const Y=new Date(I);return Y.setDate(Y.getDate()-1),N.toDateString()===Y.toDateString()?"Yesterday":N.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function w(U){t.value=U,Rt(()=>V())}function T(U){window.open(U,"_blank","noopener")}function C(U){U.target.style.display="none"}function M(){i.value=0,r=setInterval(()=>{i.value++},1e3)}function H(){r&&(clearInterval(r),r=null),i.value=0}function P(U){s.value&&(s.value=!1,H(),U.type==="chat_response"?m("bot",U.content,{tools_used:U.tools_used||[],is_error:U.is_error||!1,files:U.files||[]}):U.type==="chat_error"&&m("bot",U.error||"Unknown error",{is_error:!0}),Rt(()=>{var N;return(N=a.value)==null?void 0:N.focus()}))}async function R(U){try{const N=await q.post("/api/chat",{content:U,channel_id:l.value});m("bot",N.response,{tools_used:N.tools_used||[],is_error:N.is_error||!1,files:N.files||[]})}catch(N){m("bot",N.message||"Failed to send message",{is_error:!0})}}async function V(){const U=t.value.trim();if(!U||s.value)return;m("user",U),t.value="",s.value=!0,M(),a.value&&(a.value.style.height="auto"),Ke.connected&&Ke.sendChat(U,{channelId:l.value})||(await R(U),s.value=!1,H()),Rt(()=>{var I;return(I=a.value)==null?void 0:I.focus()})}async function Q(){try{if(!l.value){const N=await q.get("/api/auth/session");l.value=N.channel_id||N.user_id||"web-user"}const U=await q.get("/api/sessions/"+encodeURIComponent(l.value));if(U&&U.messages&&U.messages.length>0){for(const N of U.messages){const I=N.role==="user"?"user":"bot";let Y=N.content||"";if(I==="user"){const we=Y.match(/^\[.*?\]:\s*/);we&&(Y=Y.slice(we[0].length))}if(!Y.trim())continue;const Se={id:++o,role:I,content:Y,timestamp:N.timestamp?N.timestamp*1e3:Date.now(),html:I==="bot"?rp(Y):"",tools_used:[],is_error:!1,images:I==="bot"?op(Y):[],files:[],_showTools:!1};e.value.push(Se)}Rt(()=>{O(),_()})}}catch{}}return We(()=>{Ke.subscribe("chat",P),u.value=Ke.state||"disconnected",p=Ke.onStateChange,f=(U,N)=>{u.value=U,p&&p(U,N)},Ke.onStateChange=f,Q(),Rt(()=>{var U;return(U=a.value)==null?void 0:U.focus()})}),xt(()=>{Ke.unsubscribe("chat",P),Ke.onStateChange===f&&(Ke.onStateChange=p),H()}),{messages:e,input:t,sending:s,messagesEl:n,inputEl:a,canSend:d,wsStatus:b,typingText:E,suggestions:c,send:V,autoResize:x,formatTime:LS,formatDate:g,showDateSeparator:S,useSuggestion:w,openImage:T,onImageError:C,getToolIcon:MS}}},$S={setup(){const e=h("odin"),t=h(""),s=h(""),n=h(""),a=h({}),i=h([]),l=h([]),r=h(!1),o=h(!1),c=h(null),d=h(!0),u=h(""),p=h(!1),f=h(!1),b=J(()=>e.value==="custom"),y=J(()=>[...i.value,...l.value]),E=J(()=>l.value.includes(e.value)),O=J(()=>{var T;return b.value?t.value||"Odin":((T=a.value[e.value])==null?void 0:T.name)||e.value}),x=J(()=>{var T;return b.value?s.value||"(empty — will use Odin default)":((T=a.value[e.value])==null?void 0:T.identity)||""}),m=J(()=>{var T;return b.value?n.value||"(empty — will use Odin default)":((T=a.value[e.value])==null?void 0:T.voice)||""});async function _(){d.value=!0;try{const T=await q.get("/api/personality");e.value=T.preset||"odin",t.value=T.custom_name||"",s.value=T.custom_identity||"",n.value=T.custom_voice||"",a.value=T.presets||{},i.value=T.builtin_presets||[],l.value=T.user_presets||[]}catch(T){c.value=T.message}finally{d.value=!1}}async function S(){r.value=!0,c.value=null,o.value=!1;try{await q.put("/api/personality",{preset:e.value,custom_name:t.value,custom_identity:s.value,custom_voice:n.value}),o.value=!0,setTimeout(()=>o.value=!1,3e3)}catch(T){c.value=T.message}finally{r.value=!1}}async function g(){const T=u.value.trim();if(T){f.value=!0,c.value=null;try{await q.post("/api/personality/presets",{name:T,display_name:O.value,identity:x.value,voice:m.value}),p.value=!1,u.value="",await _(),e.value=T.toLowerCase().replace(/ /g,"_")}catch(C){c.value=C.message}finally{f.value=!1}}}async function w(){if(await _s({title:"Delete preset",message:`Delete preset "${e.value}"? This cannot be undone.`,confirmLabel:"Delete",danger:!0})){c.value=null;try{await q.del(`/api/personality/presets/${encodeURIComponent(e.value)}`),await _(),e.value="odin"}catch(C){c.value=C.message}}}return We(_),{preset:e,customName:t,customIdentity:s,customVoice:n,presets:a,presetNames:y,isCustom:b,isUserPreset:E,previewName:O,previewIdentity:x,previewVoice:m,saving:r,saved:o,error:c,loading:d,save:S,showSavePreset:p,newPresetName:u,savingPreset:f,saveAsPreset:g,deletePreset:w,builtinPresets:i,userPresets:l}},template:`

Personality

@@ -6035,7 +6058,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const n="

An err

- `},_t=(e,t)=>s=>({path:e,query:{...s.query,tab:t}}),qm=[{path:"/",redirect:"/dashboard"},{path:"/dashboard",component:yw,meta:{label:"Dashboard",icon:"dashboard",section:"Workspace",description:"System posture and recent activity"}},{path:"/chat",component:FS,meta:{label:"Chat",icon:"chat",section:"Workspace",description:"Direct operator conversation"}},{path:"/operations",component:uk,meta:{label:"Operations",icon:"operations",section:"Operate",description:"Execution, agents, loops, processes, and schedules"}},{path:"/history",component:bk,meta:{label:"History",icon:"history",section:"Observe",description:"Audit trail, sessions, traces, and usage"}},{path:"/capabilities",component:Ek,meta:{label:"Capabilities",icon:"capabilities",section:"Manage",description:"Tools, skills, knowledge, and memory"}},{path:"/personality",component:$S,meta:{label:"Personality",icon:"personality",section:"Manage",description:"Behavior and response profile"}},{path:"/system",component:fw,meta:{label:"System",icon:"system",section:"Manage",description:"Health, configuration, access, and updates"}},{path:"/execution",redirect:_t("/operations","live")},{path:"/agents",redirect:_t("/operations","agents")},{path:"/loops",redirect:_t("/operations","loops")},{path:"/processes",redirect:_t("/operations","processes")},{path:"/schedules",redirect:_t("/operations","schedules")},{path:"/audit",redirect:_t("/history","audit")},{path:"/sessions",redirect:_t("/history","sessions")},{path:"/traces",redirect:_t("/history","traces")},{path:"/usage",redirect:_t("/history","usage")},{path:"/tools",redirect:_t("/capabilities","tools")},{path:"/skills",redirect:_t("/capabilities","skills")},{path:"/knowledge",redirect:_t("/capabilities","knowledge")},{path:"/memory",redirect:_t("/capabilities","memory")},{path:"/learned",redirect:_t("/capabilities","learned")},{path:"/health",redirect:_t("/system","health")},{path:"/resources",redirect:_t("/system","resources")},{path:"/logs",redirect:_t("/system","logs")},{path:"/config",redirect:_t("/system","config")},{path:"/host-access",redirect:_t("/system","host-access")},{path:"/internals",redirect:_t("/system","internals")}],Oi=J_({history:A_(),routes:qm});Oi.afterEach(e=>{var s;const t=(s=e.meta)==null?void 0:s.label;document.title=t?`Odin — ${t}`:"Odin — Management"});const BS={template:` + `},_t=(e,t)=>s=>({path:e,query:{...s.query,tab:t}}),qm=[{path:"/",redirect:"/dashboard"},{path:"/dashboard",component:yw,meta:{label:"Dashboard",icon:"dashboard",section:"Workspace",description:"System posture and recent activity"}},{path:"/chat",component:FS,meta:{label:"Chat",icon:"chat",section:"Workspace",description:"Direct operator conversation"}},{path:"/operations",component:uk,meta:{label:"Operations",icon:"operations",section:"Operate",description:"Execution, agents, loops, processes, and schedules"}},{path:"/history",component:bk,meta:{label:"History",icon:"history",section:"Observe",description:"Audit trail, sessions, traces, and usage"}},{path:"/capabilities",component:Ek,meta:{label:"Capabilities",icon:"capabilities",section:"Manage",description:"Tools, skills, knowledge, and memory"}},{path:"/personality",component:$S,meta:{label:"Personality",icon:"personality",section:"Manage",description:"Behavior and response profile"}},{path:"/system",component:pw,meta:{label:"System",icon:"system",section:"Manage",description:"Health, configuration, access, and updates"}},{path:"/execution",redirect:_t("/operations","live")},{path:"/agents",redirect:_t("/operations","agents")},{path:"/loops",redirect:_t("/operations","loops")},{path:"/processes",redirect:_t("/operations","processes")},{path:"/schedules",redirect:_t("/operations","schedules")},{path:"/audit",redirect:_t("/history","audit")},{path:"/sessions",redirect:_t("/history","sessions")},{path:"/traces",redirect:_t("/history","traces")},{path:"/usage",redirect:_t("/history","usage")},{path:"/tools",redirect:_t("/capabilities","tools")},{path:"/skills",redirect:_t("/capabilities","skills")},{path:"/knowledge",redirect:_t("/capabilities","knowledge")},{path:"/memory",redirect:_t("/capabilities","memory")},{path:"/learned",redirect:_t("/capabilities","learned")},{path:"/health",redirect:_t("/system","health")},{path:"/resources",redirect:_t("/system","resources")},{path:"/logs",redirect:_t("/system","logs")},{path:"/config",redirect:_t("/system","config")},{path:"/host-access",redirect:_t("/system","host-access")},{path:"/internals",redirect:_t("/system","internals")}],Oi=J_({history:A_(),routes:qm});Oi.afterEach(e=>{var s;const t=(s=e.meta)==null?void 0:s.label;document.title=t?`Odin — ${t}`:"Odin — Management"});const US={template:`
@@ -6065,7 +6088,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const n="

An err

-
`,props:["onLogin","sessionExpired"],setup(e){const t=h(""),s=h(null),n=h(!1),a=h(!1);async function i(){n.value=!0,s.value=null;try{G.setPersist(a.value),await G.login(t.value),e.onLogin()}catch(l){s.value=l.message||"Login failed"}finally{n.value=!1}}return{token:t,error:s,busy:n,persist:a,login:i}}},US={template:` + `,props:["onLogin","sessionExpired"],setup(e){const t=h(""),s=h(null),n=h(!1),a=h(!1);async function i(){n.value=!0,s.value=null;try{q.setPersist(a.value),await q.login(t.value),e.onLogin()}catch(l){s.value=l.message||"Login failed"}finally{n.value=!1}}return{token:t,error:s,busy:n,persist:a,login:i}}},BS={template:`
Loading application... @@ -6163,4 +6186,4 @@ Please report this to https://github.com/markedjs/marked.`,e){const n="

An err

- `,setup(){const e=h("checking"),t=h(!1),s=h(!1),n=h(!1),a=h(null),i=h(null),l=h(!1);let r=null,o=null;const c=h(!1),d=h("disconnected"),u=h(-1),f=h(null);let p=null;const b=h("starting"),y=h(""),E=qm.filter(O=>O.meta),I=J(()=>["Workspace","Operate","Observe","Manage"].map(O=>({name:O,routes:E.filter(N=>N.meta.section===O)})).filter(O=>O.routes.length)),x=J(()=>{var O;return((O=Oi.currentRoute.value.meta)==null?void 0:O.label)||"Odin"}),m=J(()=>{var O;return((O=Oi.currentRoute.value.meta)==null?void 0:O.section)||"Management"}),_=J(()=>{var O;return((O=Oi.currentRoute.value.meta)==null?void 0:O.description)||"Management console"});G.onSessionExpired=()=>{t.value=!0,Ke.disconnect(),G.setToken(""),e.value="login"};function S(O){var N;if((O.ctrlKey||O.metaKey)&&O.key.toLowerCase()==="k"){e.value==="ready"&&(O.preventDefault(),Uu());return}if(n.value&&O.key==="Tab"){const Y=[...((N=a.value)==null?void 0:N.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])'))||[]];if(Y.length){const we=Y[0],ke=Y[Y.length-1];if(O.shiftKey&&(document.activeElement===we||!a.value.contains(document.activeElement))){O.preventDefault(),ke.focus();return}if(!O.shiftKey&&(document.activeElement===ke||!a.value.contains(document.activeElement))){O.preventDefault(),we.focus();return}}}if(O.key==="Escape"&&n.value){n.value=!1,O.preventDefault();return}if(O.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(O.target.tagName)){O.preventDefault();const Y=document.querySelector('.hm-main input[type="text"], .hm-main .hm-input:not(textarea):not(select)');Y&&Y.focus()}}function g(){l.value=!!(r!=null&&r.matches),l.value||(n.value=!1)}We(async()=>{document.addEventListener("keydown",S),r=window.matchMedia("(max-width: 900px)"),g(),r.addEventListener("change",g);const O=await G.check();O.ok?(e.value="ready",Q()):O.needsAuth?e.value="login":(e.value="ready",Q())});function w(){t.value=!1,e.value="ready",Q()}async function T(){await G.logout(),Ke.disconnect(),e.value="login"}function C(){s.value=!s.value}function M(){n.value=!n.value}ns(n,async O=>{var N,Y;if(O)o=document.activeElement,await Rt(),(Y=(N=a.value)==null?void 0:N.querySelector(".nav-item"))==null||Y.focus();else if(o!=null&&o.isConnected){const we=o;o=null,requestAnimationFrame(()=>we.focus())}});const H=J(()=>{switch(d.value){case"connected":return"Live";case"connecting":return"Connecting…";case"reconnecting":return"Reconnecting…";default:return"Disconnected"}});function P(O,N="info",Y=3e3){f.value={text:O,level:N},clearTimeout(p),p=setTimeout(()=>{f.value=null},Y)}let R=null,j=!1;function Q(){Ke.onStatusChange=O=>{c.value=O},Ke.onLatency=O=>{u.value=O},Ke.onStateChange=(O,N)=>{d.value=O,O==="connected"?(j&&P("Connection restored","success"),j=!0):O==="reconnecting"&&N.attempt===1&&P("Connection lost — reconnecting…","warn")},Ke.connect(),U(),R&&clearInterval(R),R=setInterval(U,15e3)}async function U(){try{const O=await G.get("/api/status");b.value=O.status==="online"?"online":"starting";const N=O.uptime_seconds||0,Y=Math.floor(N/3600),we=Math.floor(N%3600/60);y.value=`${Y}h ${we}m uptime`}catch{b.value="offline",y.value=""}}return xt(()=>{R&&clearInterval(R),Ke.disconnect(),document.removeEventListener("keydown",S),r==null||r.removeEventListener("change",g)}),{authState:e,sessionExpired:t,sidebarCollapsed:s,mobileOpen:n,wsConnected:c,wsState:d,wsLatency:u,wsLabel:H,wsToast:f,botStatus:b,botUptime:y,navRoutes:E,navGroups:I,currentPage:x,currentSection:m,currentDescription:_,sidebarEl:a,mobileMenuButton:i,isMobileViewport:l,onLogin:w,logout:T,toggleSidebar:C,toggleMobileNavigation:M,openPalette:Uu}}},zn=Jl(US);zn.component("odin-icon",gw);zn.component("login-screen",BS);zn.component("toast-container",z0);zn.component("confirm-host",V0);zn.component("command-palette",mw);zn.directive("modal-focus",bw);zn.use(Oi);zn.mount("#app"); + `,setup(){const e=h("checking"),t=h(!1),s=h(!1),n=h(!1),a=h(null),i=h(null),l=h(!1);let r=null,o=null;const c=h(!1),d=h("disconnected"),u=h(-1),p=h(null);let f=null;const b=h("starting"),y=h(""),E=qm.filter(N=>N.meta),O=J(()=>["Workspace","Operate","Observe","Manage"].map(N=>({name:N,routes:E.filter(I=>I.meta.section===N)})).filter(N=>N.routes.length)),x=J(()=>{var N;return((N=Oi.currentRoute.value.meta)==null?void 0:N.label)||"Odin"}),m=J(()=>{var N;return((N=Oi.currentRoute.value.meta)==null?void 0:N.section)||"Management"}),_=J(()=>{var N;return((N=Oi.currentRoute.value.meta)==null?void 0:N.description)||"Management console"});q.onSessionExpired=()=>{t.value=!0,Ke.disconnect(),q.setToken(""),e.value="login"};function S(N){var I;if((N.ctrlKey||N.metaKey)&&N.key.toLowerCase()==="k"){e.value==="ready"&&(N.preventDefault(),Bu());return}if(n.value&&N.key==="Tab"){const Y=[...((I=a.value)==null?void 0:I.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])'))||[]];if(Y.length){const Se=Y[0],we=Y[Y.length-1];if(N.shiftKey&&(document.activeElement===Se||!a.value.contains(document.activeElement))){N.preventDefault(),we.focus();return}if(!N.shiftKey&&(document.activeElement===we||!a.value.contains(document.activeElement))){N.preventDefault(),Se.focus();return}}}if(N.key==="Escape"&&n.value){n.value=!1,N.preventDefault();return}if(N.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(N.target.tagName)){N.preventDefault();const Y=document.querySelector('.hm-main input[type="text"], .hm-main .hm-input:not(textarea):not(select)');Y&&Y.focus()}}function g(){l.value=!!(r!=null&&r.matches),l.value||(n.value=!1)}We(async()=>{document.addEventListener("keydown",S),r=window.matchMedia("(max-width: 900px)"),g(),r.addEventListener("change",g);const N=await q.check();N.ok?(e.value="ready",Q()):N.needsAuth?e.value="login":(e.value="ready",Q())});function w(){t.value=!1,e.value="ready",Q()}async function T(){await q.logout(),Ke.disconnect(),e.value="login"}function C(){s.value=!s.value}function M(){n.value=!n.value}ns(n,async N=>{var I,Y;if(N)o=document.activeElement,await Rt(),(Y=(I=a.value)==null?void 0:I.querySelector(".nav-item"))==null||Y.focus();else if(o!=null&&o.isConnected){const Se=o;o=null,requestAnimationFrame(()=>Se.focus())}});const H=J(()=>{switch(d.value){case"connected":return"Live";case"connecting":return"Connecting…";case"reconnecting":return"Reconnecting…";default:return"Disconnected"}});function P(N,I="info",Y=3e3){p.value={text:N,level:I},clearTimeout(f),f=setTimeout(()=>{p.value=null},Y)}let R=null,V=!1;function Q(){Ke.onStatusChange=N=>{c.value=N},Ke.onLatency=N=>{u.value=N},Ke.onStateChange=(N,I)=>{d.value=N,N==="connected"?(V&&P("Connection restored","success"),V=!0):N==="reconnecting"&&I.attempt===1&&P("Connection lost — reconnecting…","warn")},Ke.connect(),U(),R&&clearInterval(R),R=setInterval(U,15e3)}async function U(){try{const N=await q.get("/api/status");b.value=N.status==="online"?"online":"starting";const I=N.uptime_seconds||0,Y=Math.floor(I/3600),Se=Math.floor(I%3600/60);y.value=`${Y}h ${Se}m uptime`}catch{b.value="offline",y.value=""}}return xt(()=>{R&&clearInterval(R),Ke.disconnect(),document.removeEventListener("keydown",S),r==null||r.removeEventListener("change",g)}),{authState:e,sessionExpired:t,sidebarCollapsed:s,mobileOpen:n,wsConnected:c,wsState:d,wsLatency:u,wsLabel:H,wsToast:p,botStatus:b,botUptime:y,navRoutes:E,navGroups:O,currentPage:x,currentSection:m,currentDescription:_,sidebarEl:a,mobileMenuButton:i,isMobileViewport:l,onLogin:w,logout:T,toggleSidebar:C,toggleMobileNavigation:M,openPalette:Bu}}},zn=Jl(BS);zn.component("odin-icon",gw);zn.component("login-screen",US);zn.component("toast-container",z0);zn.component("confirm-host",V0);zn.component("command-palette",mw);zn.directive("modal-focus",bw);zn.use(Oi);zn.mount("#app"); diff --git a/ui/dist/index.html b/ui/dist/index.html index 89e59e2a..56560ca5 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -9,7 +9,7 @@ Odin — Management - + diff --git a/ui/js/pages/schedules.js b/ui/js/pages/schedules.js index e547086d..c519ba8c 100644 --- a/ui/js/pages/schedules.js +++ b/ui/js/pages/schedules.js @@ -136,6 +136,17 @@ export default { placeholder='e.g. {"host":"server1"}' /> +
+ +

+ Requires the command to emit the generic paginated JSON contract. +

+
{{ createError }}
@@ -281,6 +292,18 @@ export default {
ID: {{ s.id }}
Action: {{ s.action }}
+
+ +
+
Report: plain text
Next run: {{ formatFuture(s.next_run) }} on trigger @@ -343,6 +366,7 @@ export default { message: '', tool_name: '', tool_input_str: '', + report_format: '', }); const creating = ref(false); const createError = ref(null); @@ -387,6 +411,7 @@ export default { const deletingId = ref(null); const togglingId = ref(null); const resettingId = ref(null); + const reportUpdatingId = ref(null); // Expanded row const expandedId = ref(null); @@ -537,6 +562,7 @@ export default { if (f.action === 'reminder' && f.message.trim()) payload.message = f.message.trim(); if (f.action === 'check') { if (f.tool_name.trim()) payload.tool_name = f.tool_name.trim(); + if (f.report_format) payload.report_format = f.report_format; if (f.tool_input_str.trim()) { try { payload.tool_input = JSON.parse(f.tool_input_str.trim()); @@ -554,6 +580,7 @@ export default { form.value = { description: '', action: 'reminder', channel_id: '', cron: '', run_at: '', message: '', tool_name: '', tool_input_str: '', + report_format: '', }; cronResult.value = null; showCreate.value = false; @@ -594,6 +621,21 @@ export default { togglingId.value = null; } + async function doUpdateReportFormat(schedule, reportFormat) { + reportUpdatingId.value = schedule.id; + try { + await api.put(`/api/schedules/${encodeURIComponent(schedule.id)}`, { + report_format: reportFormat, + }); + toast.success(reportFormat ? 'Structured report enabled' : 'Plain-text report enabled'); + } catch (e) { + toast.error(`Update failed: ${e.message}`); + } finally { + await fetchSchedules(); + reportUpdatingId.value = null; + } + } + async function doResetFailures(scheduleId) { resettingId.value = scheduleId; try { @@ -633,12 +675,12 @@ export default { showCreate, form, creating, createError, runAtUtcPreview, runAtAnalysis, runAtOccurrence, cronResult, validatingCron, cronPresets, - runningId, deletingId, togglingId, resettingId, + runningId, deletingId, togglingId, resettingId, reportUpdatingId, expandedId, history, historyLoading, historyError, cronCount, oneTimeCount, webhookCount, pausedCount, failingCount, formatTs, formatAge, formatFuture, formatMs, formatDuration, onCronInput, onRunAtInput, validateCron, toggleExpand, - fetchSchedules, doCreate, doRunNow, doTogglePause, doResetFailures, doDelete, + fetchSchedules, doCreate, doRunNow, doTogglePause, doUpdateReportFormat, doResetFailures, doDelete, }; }, };